Draw the line use the same y values, plots line at the bottom

后端 未结 1 817
小鲜肉
小鲜肉 2020-12-31 23:45

I have the same question with it

When use the same value in yAxis ,the plots line at the bottom

This is my code:

var data = [
           


        
相关标签:
1条回答
  • 2021-01-01 00:02

    The problem is that you're setting the input domain of your ranges using d3.extent. If all the values are the same, everything is going to map to a 0 y coordinate. To start the y scale at 0, replace

    y.domain(d3.extent(data, function (d) {
      return d.roundTripTime;
    }));
    

    with

    y.domain([0, d3.max(data, function (d) {
      return d.roundTripTime;
    })]);
    
    0 讨论(0)
提交回复
热议问题