Code: Select all
for (int i=0; i<series2Values.length; i++) {
if (!Double.isNaN(series2Values[i])) {
series2.add(new Hour((int)times[i], new Day()), series2Values[i]);
} else {
series2.add(new Hour((int)times[i], new Day()), null);
}
}
final TimeSeriesCollection dataset2 = new TimeSeriesCollection();
dataset2.addSeries(series2);
Code: Select all
Exception in thread "AWT-EventQueue-0" org.jfree.data.general.SeriesException: You are attempting to add an observation for the time period [6,12/7/2016] but the series already contains an observation for that time period. Duplicates are not permitted. Try using the addOrUpdate() method.
Is there a convenient way to do this with JFreeChart, or would it be more convenient to change the code so that my calls to Renjin return something formatted, rather than just plain integers between 1 and 24? (e.g. already formatted time strings)
Question has also been asked here.