I want to do this:
for (int i = 0; i < SetupCount; i++) {
String stringi = "Setup " + "#" + new Integer(i+1).toString();
setups = stringi;
series = new XYSeries(setups);
for (int j = 0; j < SetupPoints.size()/2; j+=2) {
// System.out.println(j + "= " + SetupPoints.get(j) + " and " + SetupPoints.get(j+1));
double yy = new Double(SetupPoints.get(j+1).toString()).doubleValue();
double xx = new Double(SetupPoints.get(j).toString()).doubleValue();
series.add(xx,yy);
}
dataset.addSeries(series);
}
but I want to have the name series be series1, series2, series3, depending on what 'i' is in the loop. Is there a way to do this? I thought that if I did it this way, then each time thru the other loop, series would get set to the new set of values, but it doesn't. It just keeps the first set and uses that throughout the whole graph. So there is really only 1 set of data on the graph rather than 'SetupCount' sets.
Any ideas?
Thanks.
Allyson
changing series names on the fly
Re: changing series names on the fly
It looks to me like you will get multiple series, but all containing the same values read from the SetupPoints structure.
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: changing series names on the fly
Thanks, Dave. You are right. I didn't look closely enough at the inside loop. I have been working on this code forever so sometimes I can not see what is right in front of me. Thanks for your help.
Allyson
Allyson