2.2-d3的api使用

2019-05-15  本文已影响0人  懒羊羊3号

版本问题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
上一篇 下一篇

猜你喜欢

热点阅读