Date Time labels

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

Date Time labels

Post by David » Mon Nov 25, 2002 3:47 pm

Hi,

Is it possible to have an XAxis with Date+Time labels that look like this:

25/11/2002 15:44

I tried with basicTimeSeries.add(new Day(25, SerialDate.NOVEMBER, 2002), 1);

and with basicTimeSeries.add(new Minute(new Date()), 1);

but both are not suitable I think

Thanks in advance !

David

Dave Gilbert

Re: Date Time labels

Post by Dave Gilbert » Wed Nov 27, 2002 1:33 pm

The axis label formatting is not connected to the frequency of the data in your dataset. It is all controlled by the DateFormat object in the DateTickUnit used by the DateAxis class.

The DateTickUnit is, by default, automatically selected from a standard collection of units that is created in the createStandardTickUnits() method of the DateAxis class. But you are free to create your own collection if you want to, and register it with the axis using the setStandardTickUnits(...) method.

Or, you can manually specify a single DateTickUnit for the axis. See this post for an example:

http://www.object-refinery.com/phorum-3 ... 843&t=5843

Regards,

DG

Locked