开发者

Customizing Dates on the Gantt Chart for Jasper Reports

开发者 https://www.devze.com 2023-04-12 21:29 出处:网络
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 currentl

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?

Customizing Dates on the Gantt Chart for Jasper Reports


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号