Hi,
In a DefaultCategoryDataSource it' easy to set the series names with the setSeriesNames method.
But what about the DefaultXYDataSource, the documentation says something about these being automatically generated, but nothing about changing them, and that's what I want.
I have a TimeSeriesChart with to Series in it and I want to change their names.
Could anyone help me out?
Thanks.
Gijs
Setting series names in a DefaultXYDataSource
RE: Setting series names in a DefaultXYDataSource
Gijs,
To set the series name in the TimeSeriesChart you simply send the series names to the constructor like this:
Object graphData[][][];
String seriesNames[];
DefaultXYDataSource myData = new DefaultXYDataSource
(seriesNames, graphData);
So just set the seriesNames array to what you want your names to be. I hope that helps.
By the way, Mr. Gilbert, i apologize about telling you the applet was not posting the graph data quickly. I finally figured out how to drastically speed up my application.
Still a novice,
Julio Guzman
To set the series name in the TimeSeriesChart you simply send the series names to the constructor like this:
Object graphData[][][];
String seriesNames[];
DefaultXYDataSource myData = new DefaultXYDataSource
(seriesNames, graphData);
So just set the seriesNames array to what you want your names to be. I hope that helps.
By the way, Mr. Gilbert, i apologize about telling you the applet was not posting the graph data quickly. I finally figured out how to drastically speed up my application.
Still a novice,
Julio Guzman
RE: Setting series names in a DefaultXYDataSource
Julio,
You have correctly pointed out the only way (in version 0.5.6) to set the series names in DefaultXYDataSource - thanks for posting the answer.
My intention was for DefaultXYDataSource to work the same way as DefaultCategoryDataSource so I've modified the source by copying the setSeriesNames() method from DefaultCategoryDataSource. That should allow the series names to be changed even after the data source is created.
Regards,
DG.
You have correctly pointed out the only way (in version 0.5.6) to set the series names in DefaultXYDataSource - thanks for posting the answer.
My intention was for DefaultXYDataSource to work the same way as DefaultCategoryDataSource so I've modified the source by copying the setSeriesNames() method from DefaultCategoryDataSource. That should allow the series names to be changed even after the data source is created.
Regards,
DG.