美文网首页
2.2-d3的api使用

2.2-d3的api使用

作者: 懒羊羊3号 | 来源:发表于2019-05-15 17:34 被阅读0次

版本问题v3到v4v5

//  错误提示
"export 'scale' (imported as 'd3') was not found in 'd3' 

https://github.com/d3/d3/blob/master/CHANGES.md#scales-d3-scale

scale 映射

const x = d3.scaleLinear()
    .domain([10, 130])
    .range([0, 960]);

line path

    svg.selectAll("path")
      .data(data)
      .enter()
      .append("path") // <-E
      .attr('stroke', 'red')
      .attr("fill", "none")
      .attr("d", d=>line(d)); // <-F

相关文章

网友评论

      本文标题:2.2-d3的api使用

      本文链接:https://www.haomeiwen.com/subject/ohrbvqtx.html