2

In the gantt chart on my reports I have 1 year's worth of data. I'm only interested in seeing the month printed at the top of the gantt chart. [Jan-Dec]. However, the graph currently displays the Month and the year. How would I customize the chart to just output the month?

enter image description here

monksy
  • 14,156
  • 17
  • 75
  • 124

1 Answers1

2

I'm not sure about JasperReports, but createGanttChart() uses a DateAxis as the range axis. Something like this should work:

DateAxis axis = (DateAxis) plot.getRangeAxis();
axis.setTickUnit(new DateTickUnit(
    DateTickUnit.MONTH, 1, new SimpleDateFormat("MMM-yyyy")));
monksy
  • 14,156
  • 17
  • 75
  • 124
trashgod
  • 203,806
  • 29
  • 246
  • 1,045