Customizing Dates on the Gantt Chart for Jasper Reports
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?
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")));
精彩评论