在Jasper报告的甘特图上定制日期 [英] Customizing Dates on the Gantt Chart for Jasper Reports

查看:176
本文介绍了在Jasper报告的甘特图上定制日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的报告的甘特图中,我有1年的数据。我只想看到月份印在甘特图的顶部。 [Jan-Dec]。但是,图表当前显示的是月份和年份。

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?

推荐答案

我不确定 JasperReports ,但 createGanttChart() 使用 DateAxis 作为范围轴。这样的东西应该工作:

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

这篇关于在Jasper报告的甘特图上定制日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆