I have a vertically combined CombinedXYPlot where I have more than one data series per subplot. When I set the line colours for each plot using
subplot1.setSeriesPaint(new Paint[]{Color.black, Color.yellow});
subplot2.setSeriesPaint(new Paint[]{Color.black, Color.yellow});
this works fine but the legend colours shown are still the default ones. Any fix for this?
... and one orthogonal question: with the version of JFreeChart I'm using the vertical grid-lines appear only within the gap between the 2 subplots but not in the subplots themselves. Was this bug fixed in the latest version?
Thanks,
Bruce
Legend colours wrong with CombinedXYPlot
Re: Legend colours wrong with CombinedXYPlot
Hi Bruce,
You can achieve color integrity if you also set the colors in the combinedXYPlot. (Same holds for OverlaidPlots).
It's a simple modification that is missing for now in the Overlaid... and Combined... classes.
Regards,
Andreas Schroeder
You can achieve color integrity if you also set the colors in the combinedXYPlot. (Same holds for OverlaidPlots).
It's a simple modification that is missing for now in the Overlaid... and Combined... classes.
Regards,
Andreas Schroeder
Re: Legend colours wrong with CombinedXYPlot
Thanks Andreas!
That works.
My conclusion is that I have to call setSeriesPaint() for each subplot to have the line colours correct AND setSeriesPaint() for the CombinedXYPlot to have the legend colours correct (doing only the latter does not give correct line colours for the subplots).
Thanks again for a very speedy response.
Regards,
Bruce
That works.
My conclusion is that I have to call setSeriesPaint() for each subplot to have the line colours correct AND setSeriesPaint() for the CombinedXYPlot to have the legend colours correct (doing only the latter does not give correct line colours for the subplots).
Thanks again for a very speedy response.
Regards,
Bruce
Re: Legend colours wrong with CombinedXYPlot
I've got approximately the same problem. I've got a vertical CombinedXYPlot, which combines 3 OverlaidXYPlots.
Setting the series colors on the individual OverlaidXYPlots does nothing. Setting the Series colors on the CombinedXYPlot changes the Legend, but not the colors of the series in the Overlaid plots.
If I do nothing, the colors in the plots and the legend agree, but I'd like to make the colors of similar items on the different Overlaid plots the same. This simply doesn't work. Setting colors on everything at once doesn't work either. In short, nothing changes the colors of the lines, but I can change the color of the legend (which is then inconsistent with the lines).
Setting the series colors on the individual OverlaidXYPlots does nothing. Setting the Series colors on the CombinedXYPlot changes the Legend, but not the colors of the series in the Overlaid plots.
If I do nothing, the colors in the plots and the legend agree, but I'd like to make the colors of similar items on the different Overlaid plots the same. This simply doesn't work. Setting colors on everything at once doesn't work either. In short, nothing changes the colors of the lines, but I can change the color of the legend (which is then inconsistent with the lines).
Re: Legend colours wrong with CombinedXYPlot
I've modified the code (in CVS) so that now the legend items use the colors specified in the subplots (rather than trying to have everything use the colors specified in the parent plot). I think this will work out better, but we'll see after some road testing...
Regards,
DG
Regards,
DG