美文网首页
Cannot read property 'linear' of

Cannot read property 'linear' of

作者: 神话降临 | 来源:发表于2018-08-06 16:58 被阅读0次

    原始写法

    var linear = d3.scale.linear()
           .domain([0, d3.max(dataset)])
           .range([0, 250]);
    

    In D3 v4 it is no longer named d3.scale.linear().Use d3.scaleLinear() instead.

    原因是写法被scaleLinear()代替了

    正确写法

        var linear = d3.scaleLinear()
           .domain([0, d3.max(dataset)])
           .range([0, 250]);
    

    相关文章

      网友评论

          本文标题:Cannot read property 'linear' of

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