I attempted to create a moving average dataset using the MovingAverage.createMovingAverage function
MovingAverage.createMovingAverage(dataset, " - 3 Year Moving Average", 3, 3);
where the source dataset is a TimeTableXYDataset (nothing special, a nine year span with values in the thousands). It always returned the exact same dataset as the source. Stepping into the code it looks like the calculations rely on the X value to be an index but in this case it is the long representation of a TimePeriod. I don't understand exactly why it fails but when it attempts to iterate through the offset x values to average it only takes the first value and therefore the average is of one value.
Has anyone used a TimeTableXYDataset to create a moving average dataset? I didn't generate the source dataset so it is possible this is the problem but it renders the chart as expected.
Using JFreeChart 1.0.19
UPDATE: Using a TimeSeriesCollection instead of TimeTableXYDataset seems to resolve this issue.