Customizing Dates on the Gantt Chart for Jasper Reports

雨燕双飞 提交于 2019-12-02 05:47:09

问题


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?


回答1:


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")));


来源:https://stackoverflow.com/questions/7770045/customizing-dates-on-the-gantt-chart-for-jasper-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!