I am working on a closed system and cannot copy/paste in my code, so please forgive any typos and assume that the code work until the call to tSeries.add(tsdi); where I get the General Exception "You are trying to add data where the time period class is org.jfree.data.time.Day but the time series is expecting an instance of java.sql.date".
The end goal is creating data driven time series charts spanning Jan-Dec with each series being data from a different year. The code not shown was all taken from the demos and examples found elsewhere and works with the demo data. I am trying to insert my own data at this point and encountering problems. I am working with 1.0.19 and know that these methods have been depreciated, but I'm working with what I can find for the moment.
I have tried
tSeries.add(new Day(rsGetData.getDate("date")),rsGetData.getFloat("elevation")));
tSeries.add(rsGetData.getDate("date"),rsGetData.getFloat("elevation"));
TimeSeries tSeries = new TimeSeries(theYear, Date.class);
while(rsGetData.next()){
System.out.println("1"+rsGetData.getDate("date"));
TimeSeriesDataItem tsdi = new TimeSeriesDataItem (new Day(rsGetData.getDate("date")),rsGetData.getFloat("elevation"))
System.out.println("2"+tsdi.getValue()+"::"+tsdi.getPeriod());
tSeries.add(tsdi);
System.out.println("3");
}
Answered my own question with a fresh set of eyes. The Date.class,
TimeSeries tSeries = new TimeSeries(theYear, Date.class);
had to be changed to Day.class,
TimeSeries tSeries = new TimeSeries(theYear, Day.class);
The given error didn't really point to that being the problem but it makes sense since the data presented to the TimeSeries tSeries is a Day not a Date.
On to the next hurdle of setting up a domain range of Jan-Dec without concern for the year.
Thanks to any all who many of looked at this question and spent time trying to figure it out. @trashgod, I will try to make my questions more complete in the future.