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

前端 未结 1 1731
梦毁少年i
梦毁少年i 2021-01-20 05:48

I´m using a simple area chart based on a simple Dataset like this:

DateTime(sql.timestamp) |Value(Integer)
2012-02-17 00:02:02     |100
2012-02-17 00:02:08           


        
相关标签:
1条回答
  • 2021-01-20 06:26

    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: Nice Time Series Chart

    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.

    0 讨论(0)
提交回复
热议问题