Here's the problem, Lucian:
http://i.imgur.com/VIvrA.png
That's not an expression. That means once you create the chart's "Time period", it cannot be (easily) changed.
If you wanted to reuse the same report, but give the users the ability to change the time series, you have two options:
1. (a) Duplicate the chart for each Time period.
1. (b) Set a PrintWhenExpression values using the parameter that controls the Time period.
For example, if the user selects "Hourly" then the Year, Quarter, Month, Week, Day, Minute, and Second charts would not be printed. But that means having 8 copies of the same chart.
Problem: When you have to fix a mistake, or need to change the chart, you have to remember to update 8 charts that are all the same.
-or-
2. Add some code that assigns the appropriate org.jfree.data.time.X class to the JRTimeSeriesDataset's time period.
Problem: The method for setTimePeriod() is unimplemented.
The code is being called within a chart customizer:
public abstract class SplineCustomizer
extends JRAbstractChartCustomizer {
public void customize( JFreeChart jFreeChart, JRChart jrChart ) {
configureTrendLine();
}
}
( See also: http://jasperforge.org/plugins/mantis/view.php?id=4657 )
For me, the best solution would be to have two options. The basic option is just to select the Time period as shown in the screen shot.
The Advanced Options would allow you to make it an expression that maps a string version of the Time period to the class. For example "Year" means to use org.jfree.data.time.Year.class.
That way report developers are free to make the time period completely configurable, without having to have octuplicated code. This could also open the door for a factory implementation that allows bi-weekly, bi-monthly, or any other type of time period that is not natively supported by the framework.