Normalize DateAxis?

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

Normalize DateAxis?

Post by Don Mitchell » Wed Jan 15, 2003 7:25 pm

I have a chart that contains sampling data points. The user wants the choice to either see the Date/Time stamp for the sampling points along the x-axis or see the sampling interval. For instance if the sampling rate is every five minutes, they either want to see the actual times the samples were taken or just see 0 5 10 15 ... etc.

By switching between a DateAxis and NumberAxis, I can get a similar effect, but instead of 0 5 10 15, I get the long for the date/time stamp (in milliseconds since 1970).

So my question is: is there a way to tell JFreeChart to normalize these numbers? It knows the start date for the first sample, I would just need to give it some factor to divide the milliseconds by to tell it that I want the data normalized to minutes or hours, etc.

I can do this in my own code too, but I was wondering if there was any tricks to do this in JFreeChart.

Thanks,
Don

David Gilbert

Re: Normalize DateAxis?

Post by David Gilbert » Thu Jan 16, 2003 4:34 pm

Hi Don,

Unfortunately there's no code that will do that for you at present, except of course your own!

Regards,

Dave Gilbert

Locked