Gantt Chart Date Labels

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

Gantt Chart Date Labels

Post by Scott » Thu Sep 05, 2002 7:35 pm

Hi,

I would like to customize my Date Labels on the X Axis of a Gantt Chart. My default is one day, so I would like to show 24 hours on the x axis.

How do I customize the date range? Here is the code I have so far.

HorizontalCategoryPlot plot = (HorizontalCategoryPlot)chart.getPlot();
HorizontalDateAxis rangeAxis = (HorizontalDateAxis)plot.getRangeAxis();
rangeAxis.setLabel("Scheduled Dates");
rangeAxis.setTickUnit(new DateUnit(Calendar.HOUR_OF_DAY,24));

I would like to see the tick marks and labels in interval of 1 hour.

Any help would be appreciated.

Thanks!
Scott

David Gilbert

Re: Gantt Chart Date Labels

Post by David Gilbert » Fri Sep 06, 2002 10:19 am

I think you should try:

rangeAxis.setTickUnit(new DateUnit(Calendar.HOUR_OF_DAY,1));

Regards,

DG.

Locked