d3.js & nvd3.js — How to set y-axis range

后端 未结 6 1531
闹比i
闹比i 2020-12-05 04:00

I\'m trying to set the y-axis range of the chart from 1-100.

Consulted the API documentation and found a possible solution with axis.tickValues as seen here https://

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 04:28

    If you mean setting the y-domain (the range of numbers that should be displayed) for stacked area charts, this works for me:

    nv.models.stackedAreaChart()
      .x(function(d) {...})
      .y(function(d) {...})
      .yDomain([0, maxY])
    ...
    

提交回复
热议问题