I got only one data - timeseries

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
timokai
Posts: 3
Joined: Thu Aug 14, 2003 1:39 pm
Contact:

I got only one data - timeseries

Post by timokai » Thu Aug 21, 2003 10:44 am

Hi,
I try to make a Timeseries Chart. I got the data from a sql server. But my chart will show me only one data (the first). here my code:

Object sqldata[][];
sqldata = svb.getData("Select dtedit,substring(xstrlogger,14,5) from xvictemperatur where xstrlogger Not Like '%started'");
for (int i=0; i<sqldata.length;++i)
{
Date ts = (Date)sqldata[0];
double value = Double.parseDouble((String)sqldata[1]);
Day day = new Day(ts);
series1.add(day,value);
}

svb is a Bean and the function getData work correctly! I have 1305 data in sqldata!
Could someone help me?
thx

rfuller
Posts: 8
Joined: Tue Aug 19, 2003 2:34 pm
Location: Galway, Ireland

Post by rfuller » Thu Aug 21, 2003 3:27 pm

Are you being thrown out of your loop with an Exception when trying to add a duplicate day to your series?

series1.add(day,value); // each day must be unique

timokai
Posts: 3
Joined: Thu Aug 14, 2003 1:39 pm
Contact:

Post by timokai » Thu Aug 21, 2003 3:36 pm

I have solve the problem! The second data will have the same day! And so i got an exception.

Locked