I have created serveral jchart: line, bar, area, pie and stackedbar by using a DefaultCategoryDataset contructed like these:
DefaultCategoryDataset chartData =
new DefaultCategoryDataset(series, categories, dataSet);
and the code to create a chart is like these:
chart = ChartFactory.createLineChart
(title, domainAxis, rangeAxis, chartData, legend);
Here serires is a String[], categories a Object[], dataSet Number[][].
The charts can display category name and the target real chart. But I don't see any series names is displayed.
I put this after I created DefaultCategoryDataset:
for (int i=0;i<chartData.getSeriesCount() ;i++ )
{
System.out.println(chartData.getSeriesName(i));
}
and see the series names are displayed in my console.
Is there anybody who has a clue what should I do in order to display these series names in my charts?
Thank you.
Georgia
Displaying Series Name
Re: Displaying Series Name
It sounds like it should be working, as long as 'legend' is set to true.
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: Displaying Series Name
Hello Georgia,
I'm sure I understand Your problem...
In case You want to display the series names in the legend, You have to indicate the chartFactory method You want to show the legend.
This is done by assigning a true value to the boolean parameter legend.
Does that answer Your question ?
Best regards,
Arnaud
I'm sure I understand Your problem...
In case You want to display the series names in the legend, You have to indicate the chartFactory method You want to show the legend.
This is done by assigning a true value to the boolean parameter legend.
Does that answer Your question ?
Best regards,
Arnaud
Re: Displaying Series Name
Dave $ Arnaud,
Thank you very much.
That's really solved the problem. I set my testing html page with legend being set to "ture". But it has never been parsed to the ChartFactory object.
Now, everything is working.
Bin
Thank you very much.
That's really solved the problem. I set my testing html page with legend being set to "ture". But it has never been parsed to the ChartFactory object.
Now, everything is working.
Bin