views:

345

answers:

1

Hi,

I created a stacked bar chart using JFreeChart (similar to this one). Now I would like to connect the points of the corresponding series for all rows. Is this possible using JFreeChart?

+1  A: 

Although I'm not completely sure I understand what you want, I guess you might want to look into the LineAndShapeRenderer and/or the XYLineAndShapeRenderer classes in the JFreeChart library.

Check these (slightly dated) samples (and the related ones at the end of linked page) for what they can do and if that is what you want to achieve

JFreeChart: XYLineAndShapeRenderer Demo

FreeChart: Line Chart Demo

jitter
I discovered that this solves my problem indeed. I thought it was not possible to use these renderers in a stacked bar chart, because there is only one type of dataset possible. But you can use the LineAndShapeRenderer with the DefaultKeyedValues2DDataset dataset.
Fortega