JasperReports: How to mask or filter the labels at the chart's axis

眉间皱痕 提交于 2019-12-01 22:31:13

Use a Timeseries chart instead of a Line chart. You should get exactly what you're looking for that way.

EDIT: I tested with your supplied .jrxml and data. It works well:

But... there seems to be a bug in iReport. You cannot set the time period in the iReport GUI. Perhaps this is what is causing you problems. It was very confusing to me. iReport generates this regardless of what time period you attempt to choose:

<timeSeriesDataset>

But you need to manually change the JRXML to this:

<timeSeriesDataset timePeriod="Second">

Once you do that, then you'll get a nice chart. At least iReport doesn't remove the correct timePeriod info... so you only have to do it once.

Note: If you're concerned about details like getting your date info to display on 2 lines, this is possible as well. I hate being stuck with a single line. I wrote an article about that last year. Look for the section Category Labels on multiple lines.

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