Gantt Tick Units

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

Gantt Tick Units

Post by Jon Theophilus » Mon Nov 04, 2002 4:46 pm

This is my process for creating the Gantt chart. I have a class wich is a subclass of another class called GanttRenderer.

setDataset(this.createDataset(s,dropFlag));
setTitle(null);

ChartPanel chartPanel = super.createGantt();

Calendar calendar = Calendar.getInstance();
Date startDate = date(1,Calendar.JANUARY,calendar.get(Calendar.YEAR));
Date endDate = date(31,Calendar.DECEMBER,calendar.get(Calendar.YEAR));

JFreeChart chart = this.getChart();
CategoryPlot plot = chart.getCategoryPlot();
DateAxis axis = (DateAxis) plot.getRangeAxis();
axis.setMinimumDate(startDate);
axis.setMaximumDate(endDate);

DateUnit tick = new DateUnit(Calendar.MONTH,12);
axis.setTickUnit(tick);

Any ideas?

Dave Gilbert

Re: Gantt Tick Units

Post by Dave Gilbert » Mon Nov 04, 2002 5:36 pm

Hi John,

In 0.9.4, the DateUnit class is not used, it has been replaced with DateTickUnit.

Regards,

DG

Locked