Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set maximum x and y axis range NVD3

Tags:

graph

nvd3.js

I am trying to plot the line graph using NVD3. But the issue I am facing is that the maximum values of x and y axis get adjusted automatically depending on the data provided. But I don't want this default behavior, I want to preset the maximum values for X and Y axis. Is there an option to do so in NVD3?

Tried this domain approach but didn't work

like image 510
Mitaksh Gupta Avatar asked Jan 30 '26 03:01

Mitaksh Gupta


1 Answers

You could try chart.forceY([minValue, maxValue]).

NVD3 is built on D3 so if you are to look deep, it's best to look into the D3 Api.

like image 100
shabeer90 Avatar answered Feb 03 '26 08:02

shabeer90



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!