Question on timeseries chart X-axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Artemis

Question on timeseries chart X-axis

Post by Artemis » Fri Dec 27, 2002 9:19 am

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

David Gilbert

Re: Question on timeseries chart X-axis

Post by David Gilbert » Thu Jan 02, 2003 11:54 am

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

Locked