There are a number of examples in the demo that have various Overlaid plots. I have not been able to successfully try an overlay of a line chart onto a histogram.
If I am starting with ChartFactory.createHistogram can I add the line chart to the histogram with plot.setDataset(1, addedDataset); like in the demos?
Thanks!
Histogram Overlay
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Histogram Overlay
If I recall correctly, you'll also need a second renderer for the overlaid dataset. As your factory uses an XYBarRenderer, I'd look at an XYItemRenderer.
Re: Histogram Overlay
I am using an XYLineAndShapeRenderer but nothing additional is displaying. The additional dataset is populated in the XYplot, just not displaying... so does that mean it is likely something to do with the renderer?
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Histogram Overlay
You should be able to test them separately by commenting out one or the other; then check that the indices are correct.