I have the following values to be shown in a BAR chart in my Java web application. 9.46373791E8 9.45942547E8 9.45559945E8 9.45187023E8 9.44856693E8 9.44417826E8 9.44007878E8
Since the y-axis in your example is an instance of NumberAxis
you can call the method setAutoRangeIncludesZero()
on the axis (passing false for the new value of the flag).
Then, even if you add new data to the dataset
, the axis range will be updated correctly (whereas calling setLowerBound()
will fix the axis range with the lower bound you specify, and disable the auto-range feature).