I have a line chart using a StandardXYItemRenderer. Is there an easy way to convert my line chart to a bar chart, I mean, without having to reconstruct my dataset? Right now I currently create a TimeSeriesCollection dataset for lines and a DefalutCategoryDataset for bars. Thanks for any/all input!
Stacey
Best way to convert line chart to bar chart?
P.S.... Best way to convert line chart to bar chart?
PS...
I should have mentioned that I would like all series to be visible (side by side) not overtop of each other.
I should have mentioned that I would like all series to be visible (side by side) not overtop of each other.
Re: Best way to convert line chart to bar chart?
The TimeSeriesCollection class implements the XYDataset interface.
The DefaultCategoryDataset class implements the CategoryDataset interface.
These two interfaces are quite different, so you can't interchange them. But you can create a simple bar chart using a TimeSeriesCollection...try the createVerticalXYBarChart(...) method in the ChartFactory class. This 'XY' bar chart doesn't have the same range of options as the regular bar charts based on the CategoryDataset interface, but maybe it will be enough for you.
Regards,
DG.
The DefaultCategoryDataset class implements the CategoryDataset interface.
These two interfaces are quite different, so you can't interchange them. But you can create a simple bar chart using a TimeSeriesCollection...try the createVerticalXYBarChart(...) method in the ChartFactory class. This 'XY' bar chart doesn't have the same range of options as the regular bar charts based on the CategoryDataset interface, but maybe it will be enough for you.
Regards,
DG.