Hi all,
I am creating a timeseries chart. I want to ask how can I change the display value for the time value axis ?
The default time interval seems to be 7 days, which class should I modify to change it ?
Thanks.
Artemis
Question on timeseries chart X-axis
Re: Question on timeseries chart X-axis
Hi Artemis,
A standard time series chart is set up using an XYPlot with a HorizontalDateAxis. You have two options if you want greater control over the tick units on the axis:
(1) Set the tick size manually using the setTickUnit(...) method (defined in the DateAxis class). You have to take responsibility for ensuring that the tick labels do not overlap in this case.
(2) Change the collection of standard tick units using the setStandardTickUnits(...) method (defined in the ValueAxis class). Take a look at the source code for the createStandardDateTickUnits(...) method in the DateAxis class for an example of creating a tick unit collection - JFreeChart will automatically choose one of these tick sizes so that the tick labels do not overlap.
Regards,
Dave Gilbert
A standard time series chart is set up using an XYPlot with a HorizontalDateAxis. You have two options if you want greater control over the tick units on the axis:
(1) Set the tick size manually using the setTickUnit(...) method (defined in the DateAxis class). You have to take responsibility for ensuring that the tick labels do not overlap in this case.
(2) Change the collection of standard tick units using the setStandardTickUnits(...) method (defined in the ValueAxis class). Take a look at the source code for the createStandardDateTickUnits(...) method in the DateAxis class for an example of creating a tick unit collection - JFreeChart will automatically choose one of these tick sizes so that the tick labels do not overlap.
Regards,
Dave Gilbert