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?
Asked
Active
Viewed 2,550 times
1 Answers
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")));
-
I can use this in the ChartCustomizer, which gives me direct access to the JFreeChart object. – monksy Oct 14 '11 at 19:47
-
Ah, part of JasperReports; post back with your results. – trashgod Oct 14 '11 at 23:56