label with SimpleDateFormat

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

label with SimpleDateFormat

Post by Bob » Tue Feb 25, 2003 3:43 am

hi,
I want my x to show, date and time, so I put this

xAxis.setTickUnit(new DateTickUnit(DateTickUnit.DAY,2,new SimpleDateFormat("MM/dd/yy hh:mm:ss")));

however, it is too long on the chart, so I try to make it into to line such as

"01/05/1977
12:00:30"

instead of

"01/05/1977 12:00:30"

is there any way to do so? thank you
I try xAxis.setTickUnit(new DateTickUnit(DateTickUnit.DAY,2,new SimpleDateFormat("MM/dd/yy\nhh:mm:ss")));
and
xAxis.setTickUnit(new DateTickUnit(DateTickUnit.DAY,2,new SimpleDateFormat("MM/dd/yy'\n'hh:mm:ss")));

and they don't work.

thank you!

David Gilbert

Re: label with SimpleDateFormat

Post by David Gilbert » Wed Feb 26, 2003 12:56 am

At the moment, the axis classes draw tick labels on a single line. You will have to modify the code to use multiple lines if you need that feature.

Regards,

Dave Gilbert

Locked