How would you create a line in JasperReports that follows the trend for the data, in addition to showing the data points? Here are before and after shots:
Before
After
The Time Series report does not appear to have any such option to draw the orange line. (The orange line should be smooth, and thinner, but that's the general idea.)
Any ideas how to craft such a report with iReport 3.7.1?
One solution requires the following items:
BezierLineCustomizer
to make the lines curved.RunningAverageIncrementer
to calculate a running average based on a variable.RunningAverageIncremeter
.BezierLineCustomizer Class
RunningAverageIncrementer Class
iReport Variable
Create a variable that uses the
RunningAverageIncrementerFactory
class (exercise left to the reader). Set its variable expression to the plotted value. Set its initial value expression to zero.Spline
Set the Customizer Class property of the TimeSeries chart to use the
BezierLineCustomizer
class.Result
After these modifications, the running average is clearly visible: