D3.js error using timescale (path is NaN)

前端 未结 1 1660
傲寒
傲寒 2021-01-29 01:12

Im using d3.js to make a heatmap. My data is an object out of which i have pulled out the maximum and minimum year. When i use d3.timeScale() to initialise my x axi

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-29 01:53

    In D3 scales, you have to pass an array to range. The API is clear:

    If range is specified, sets the scale’s range to the specified array of values. (emphasis mine)

    Therefore, it should be:

    .range([0, WIDTH]);
    

    0 讨论(0)
提交回复
热议问题