I'm not sure if this is possible but here we go. Is there a way to convert a string to a Dataset? Let me explain. I have a list of persons that i need to represent on a JFreeChart line-chart and I therefore need to create a dataset for each person. Can I create datasets (possibly named after each person) for each person that is in the list? Something like this...
public XYDataset createDatasets(List<String> personList) {
XYSeriesCollection seriesColletion = new XYSeriesCollection();
for(String person : personList) {
XYSeries person = new XYSeries(person);
seriesColletion.addseries(person);
}
return seriesColletion;
}
Or is there a smarter, better way of going about it? I'm sure this code doesn't work (particularly lines 3-6) but i'm only using it to better explain this.