Question on horizontal display

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

Question on horizontal display

Post by Artemis » Mon Jan 13, 2003 6:50 pm

Hi ,

I am creating a time-series chart using JFreeChart-0.9.3.
I just want to display the date in the horizontal axis for every day.
How can I get this done with 0.9.3 ?

Thanks so much.

David Gilbert

Re: Question on horizontal display

Post by David Gilbert » Tue Jan 14, 2003 9:53 am

In 0.9.3, you could call the setTickUnit(...) method on the DateAxis and pass it a DateUnit object. The DateUnit could be constructed like this to represent one day:

DateUnit unit = new DateUnit(Calendar.DATE, 1);

This has changed in 0.9.4 to work the same way as the NumberAxis tick units.

Regards,

Dave Gilbert

Artemis

Re: Question on horizontal display

Post by Artemis » Tue Jan 14, 2003 11:47 am

Thanks DG,

I got every day is displayed but the date is overlapped.
How can I make the date displayed vertically to avoid the overlapping ?

Thanks so much.

David Gilbert

Re: Question on horizontal display

Post by David Gilbert » Wed Jan 15, 2003 10:59 am

Hi Artemis,

I think it is something like this:

XYPlot plot = myChart.getXYPlot();
HorizontalDateAxis axis = (HorizontalDateAxis) plot.getDomainAxis();
axis.setVerticalTickLabels (true);

Regards,

Dave Gilbert

Artemis

Re: Question on horizontal display

Post by Artemis » Wed Jan 15, 2003 4:47 pm

It works.

Thanks a lot !

:)

Locked