Set Auto to XYAreaChart

I am using the JFreechat API to draw an XYAreaChart with a TimeSeriesCollection dataset. The values ​​that I put in the data set are variables without restrictions: they can go from 0 to more than 1000. The problem is that I want ValueAxis to automatically match the data.

I tried using:

    XYPlot plot = mychart.getXYPlot();
    ValueAxis axis = plot.getDomainAxis();
    axis.setAutoRange(true);

I see that with setAutoRange this is not so "automatic". It is true that it changes the axis when the graph gets larger values, but it does not change the axis size when there is no larger data, as shown here:

enter image description here

enter image description here

enter image description here

, Range (~ 400 ), .   ?

+3
1

:

  • , , DynamicTimeSeriesCollection, .
  • , , TimeSeriesCollection, .
+1

All Articles