第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

使用D3制作圖表

LuckyYang 其它
難度中級
時長 1小時52分
學習人數(shù)
綜合評分9.47
36人評價 查看評價
9.9 內(nèi)容實用
9.3 簡潔易懂
9.2 邏輯清晰
  • // svg

    const SVG_WIDTH = 500

    const SVG_HEIGHT = 250

    const SVG_MARGIN = { left: 50, top: 30, right: 20, bottom: 20 }

    const G_WIDTH = SVG_WIDTH - SVG_MARGIN.left - SVG_MARGIN.right

    const G_HEIGHT = SVG_HEIGHT - SVG_MARGIN.top - SVG_MARGIN.bottom


    // d3.select('#container').append('svg:svg')

    const svg = d3

    ?.select('#container')

    ?.append('svg')

    ?//width height

    ?.attr('width', SVG_WIDTH) // attribute

    ?.attr('height', SVG_HEIGHT)


    const g = d3

    ?.select('svg')

    ?.append('g')

    ?.attr('transform', `translate(${SVG_MARGIN.left}, ${SVG_MARGIN.top})`)


    const data = [1, 3, 5, 7, 8, 4, 3, 7]


    const scaleX = d3

    ?.scaleLinear()

    ?.domain([0, data.length]) // 輸入的范圍

    ?.range([0, G_WIDTH]) // 輸出的范圍


    const scaleY = d3

    ?.scaleLinear()

    ?.domain([0, d3.max(data)]) // 輸入的范圍

    ?.range([G_HEIGHT, 0]) // 輸出的范圍


    // const lineGenerartor = d3.svg

    const lineGenerartor = d3

    ?.line()

    ?// .x((d, i) => i) // 0,1,2,3,4

    ?.x((d, i) => scaleX(i)) // 0,1,2,3,4

    ?.y((d) => scaleY(d)) // 1, 3, 5, 7, 8, 4, 3, 7

    ?// .interpolate('cardinal') // 線的擬合方式

    ?.curve(d3.curveCatmullRom.alpha(0.5)) // 線的擬合方式


    g.append('path').attr('d', lineGenerartor(data)) //d=M1,0L20,$0L40,50L!00,200L0,200 ? d : is a short for path data


    const xAxis = d3.axisBottom(scaleX)

    const yAxis = d3.axisLeft(scaleY)


    g.append('g').call(xAxis).attr('transform', `translate(0, ${G_HEIGHT})`)


    g.append('g').call(yAxis)




    查看全部
    0 采集 收起 來源:坐標系繪制

    2020-08-01

  • // svg

    const SVG_WIDTH = 500

    const SVG_HEIGHT = 250

    const SVG_MARGIN = { left: 50, top: 30, right: 20, bottom: 20 }

    const G_WIDTH = SVG_WIDTH - SVG_MARGIN.left - SVG_MARGIN.right

    const G_HEIGHT = SVG_HEIGHT - SVG_MARGIN.top - SVG_MARGIN.bottom


    // d3.select('#container').append('svg:svg')

    const svg = d3

    ?.select('#container')

    ?.append('svg')

    ?//width height

    ?.attr('width', SVG_WIDTH) // attribute

    ?.attr('height', SVG_HEIGHT)


    const g = d3

    ?.select('svg')

    ?.append('g')

    ?.attr('transform', `translate(${SVG_MARGIN.left}, ${SVG_MARGIN.top})`)


    const data = [1, 3, 5, 7, 8, 4, 3, 7]


    const scaleX = d3

    ?.scaleLinear()

    ?.domain([0, data.length]) // 輸入的范圍

    ?.range([0, G_WIDTH]) // 輸出的范圍


    const scaleY = d3

    ?.scaleLinear()

    ?.domain([0, d3.max(data)]) // 輸入的范圍

    ?.range([G_HEIGHT, 0]) // 輸出的范圍


    // const lineGenerartor = d3.svg

    const lineGenerartor = d3

    ?.line()

    ?// .x((d, i) => i) // 0,1,2,3,4

    ?.x((d, i) => scaleX(i)) // 0,1,2,3,4

    ?.y((d) => scaleY(d)) // 1, 3, 5, 7, 8, 4, 3, 7

    ?// .interpolate('cardinal') // 線的擬合方式

    ?.curve(d3.curveCatmullRom.alpha(0.5)) // 線的擬合方式


    g.append('path').attr('d', lineGenerartor(data)) //d=M1,0L20,$0L40,50L!00,200L0,200 ? d : is a short for path data


    const xAxis = d3.axisBottom(scaleX)

    const yAxis = d3.axisLeft(scaleY)


    g.append('g').call(xAxis).attr('transform', `translate(0, ${G_HEIGHT})`)


    g.append('g').call(yAxis)




    查看全部
    0 采集 收起 來源:坐標系繪制

    2020-08-01

  • 簡單可視化
    查看全部
    0 采集 收起 來源:餅狀圖(下)

    2019-12-27

  • enter
    查看全部
    0 采集 收起 來源:水平柱狀圖表

    2019-08-01

  • https://blog.csdn.net/ysj1218/article/details/80523474,鏈式調(diào)用有點類似于jQuery

    查看全部
    0 采集 收起 來源:畫布制作

    2019-05-18

  • https://img1.sycdn.imooc.com//5becd4de000161ac13150740.jpg

    查看瀏覽器的支持列表

    ????支持svg的瀏覽器,對d3的支持還是比較好的

    查看全部
    0 采集 收起 來源:課程簡介

    2018-11-15

  • d3代碼在github上https://img1.sycdn.imooc.com//5becd4880001947713130738.jpg

    查看全部
    0 采集 收起 來源:課程簡介

    2018-11-15

  • select&selectAll? 選擇html上的dom元素

    append? 添加我們想要的一些元素

    讀取和使用數(shù)據(jù)? 使用一些函數(shù)來讀取和使用數(shù)據(jù),也可以使用dsv、csv一些數(shù)據(jù)格式

    https://img1.sycdn.imooc.com//5becd3460001776f13120739.jpg

    查看全部
    0 采集 收起 來源:課程簡介

    2018-11-15

  • https://img1.sycdn.imooc.com//5becd30800019ac513120739.jpg可以做什么

    查看全部
    0 采集 收起 來源:課程簡介

    2018-11-15

  • g元素 相當于html中的div,可以理解為group
    查看全部
    0 采集 收起 來源:畫布制作

    2018-10-07

  • d3.select(selector) 選擇符合條件的第一個元素 d3.selectAll(selector)選擇符合條件的所有元素
    查看全部
  • v4用新的曲線API來說明如何根據(jù)數(shù)據(jù)為line和area插值。line.interpolate和area.interpolate方法由line.curve和area.curve代替。 1, curveCatmullRom 2, curveCatmullRomClosed 3, curveCatmullRomOpen this._d3.line().curve(this._d3.curveCatmullRom.alpha(.5));
    查看全部
    1 采集 收起 來源:坐標系繪制

    2017-12-26

  • V4 nterpolate("cardinal") -> curve(d3.curveCardinal); d3.svg.line() -> d3.line() d3.scale.linear() -> d3.scaleLinear()
    查看全部
    2 采集 收起 來源:繪制曲線

    2018-03-22

  • bost.ocks.org/mike/circles/
    查看全部
首頁上一頁1234567下一頁尾頁

舉報

0/150
提交
取消
課程須知
有html,css和javascript基礎(chǔ)的同學學習這門課程會比較容易一些。沒有基礎(chǔ)的同學,也可以通過課程里面的例子加深自己對相關(guān)知識的理解。
老師告訴你能學到什么?
如何使用select和selectAll選擇DOM元素、如何使用append添加DOM元素、如何使用line,area等方法生成圖表曲線、如何使用數(shù)據(jù)文件讓我們的圖表可以隨著數(shù)據(jù)變化而動態(tài)更新。

微信掃碼,參與3人拼團

微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網(wǎng)的支持!