I'm new to JFreeChart and trying to get my first chart going (I did the demo and it worked fine). I build a TimeSeries chart but when I run it nothing displays. Below is part of the code...anything that anyone could help with would be very appreciated. Thanks, Kenny
String sql = "SELECT SIGNAL_DATE, INDEX_VAL FROM KENNY.PTS_INDX " +
"ORDER BY SIGNAL_DATE";
ResultSet myResultSet = myStatement.executeQuery(sql);
while (myResultSet.next())
{
signalDate = myResultSet.getString("SIGNAL_DATE");
indexValue = myResultSet.getDouble("INDEX_VAL");
dayString = signalDate.substring(8, 10);
dayValue = Integer.parseInt(dayString);
monthString = signalDate.substring(5, 7);
monthValue = monthConvert(monthString);
yearString = signalDate.substring(0, 4);
yearValue = Integer.parseInt(yearString);
seriesDay = new Day(dayValue, monthValue, yearValue);
series1.add(seriesDay, indexValue);
}
TimeSeriesCollection seriesCollection = new TimeSeriesCollection(series1);
JFreeChart chart = ChartFactory.createTimeSeriesChart("Title", "X", "Y",
seriesCollection, true);
response.setContentType("image/jpeg");
ChartUtilities.writeChartAsJPEG(out, chart, 600, 400);
Chart servlet not displaying
Re: Chart servlet not displaying
Nevermind on this....I figured it out. My servlet was bombing out because I was trying to insert duplicate days into my series. Thanks,
Kenny
Kenny