Displaying negative times using a data axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Muriel
Posts: 4
Joined: Mon Jul 12, 2004 8:30 am

Displaying negative times using a data axis

Post by Muriel » Mon Jul 12, 2004 8:36 am

Is it possible to display negative times using the date axis ?
I would like to have a date axis which can display the time as below:

__________________
-50 -40 -30 -20 -10 0

I would like to use a Date Axis, because then I can set a format for this one. The example above displays the time in seconds. If I now set the format to "mm:ss" the above should look like this:

______________________________________
-00:50 -00:40 -00:30 -00:20 -00:10 00:00

Can anybody help me ??

Thanks already,

Greetings Muriel

BigWillyStyle42
Posts: 58
Joined: Wed Jun 02, 2004 1:37 pm

Post by BigWillyStyle42 » Mon Jul 12, 2004 7:34 pm

I don't think you can. Negative values would most likely be interpreted as dates prior to 00:00 January 1, 1970 GMT.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Jul 12, 2004 10:04 pm

I think it would be great if someone wrote a subclass of DateFormat that could convert a java.util.Date into a String in the form 'hh:mm:ss' relative to some base date (default 1-Jan-1970, but user configurable). A +/- sign would be an added bonus. Some rainy day I might do this myself...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked