Search code examples
jasper-reportstime-seriesireport

Average line in time series with iReport


how can i draw the average line in a time series?


Solution

  • Solutions

    There are a few ways to do this:

    In-line Analysis

    The disadvantage to performing the analysis in-line is that JasperReports plots a single value at a time. Any customizer you write will have to calculate the trend based on the past data points, rather than an analysis on all the data points at the end. This will cause a slight skew to the data line.

    Integrated Stats Package

    The disadvantage to using a statistics package is that you would have to find a way to integrate it with your database. (You would also have to learn the corresponding statistical functions to perform the analysis.)

    Third-party Tool

    The disadvantage here is that you might have to pay for the product, or support. The integration is likely the easiest.

    Recommended Solution

    If you have a PostgreSQL database, I would recommend installing PL/R. Use R to perform the aggregate data analysis and then send the result back to JasperReports for the time series chart.

    What you are asking to do can be quite involved.