Change the starting value of value axis in Bar chart with Jfreechart

后端 未结 2 722
陌清茗
陌清茗 2021-01-23 09:00

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

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-23 09:29

    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).

提交回复
热议问题