All:
It seems as though the series colors change ordering depending on whether or not I include legends when calling the following methods:
ChartFactory.createHistogram
ChartFactory.createScatterPlot
If I call those methods with display legend set to true then the series are red then blue (for a 2 series graph). If I call it with legends set to false, then it is blue then red.
However, using ChartFactory.createBoxAndWhiskerChart does the correct thing and the series are red then blue regardless of whether or not I have set legends to true or false.
This makes it confusing because I have one application that draws all three graphs of the same data on the same screen for comparison. If legends are ON, then everything matches. If the user selects and option I have to turn legends OFF, then the colors don't match from the histogram and statter to the boxplot since the series colors are reversed on 2 of them.
I am using the default colors that the graphs automatically draw with.
Any ideas?
Thanks
Paul
Legend Display OFF - caused series color change
-
- Posts: 15
- Joined: Wed Nov 07, 2007 6:20 pm
-
- Posts: 15
- Joined: Wed Nov 07, 2007 6:20 pm
More detail - reversing all colors and symbols
I have more data for you all.
I graphed a series of 5 and I noticed that it is simply reversing the colors and symbols for each series.
So intead of Red, Blue, Green, Yellow, Purple when legends are ON, it displays the graph as Purple, Yellow, Green, Blue, Red when legends are OFF. Also, for the scatter plot where each series has a different symbol, those are also changing and following the color as they move.
Let me know.
Thanks
Paul Belleville
I graphed a series of 5 and I noticed that it is simply reversing the colors and symbols for each series.
So intead of Red, Blue, Green, Yellow, Purple when legends are ON, it displays the graph as Purple, Yellow, Green, Blue, Red when legends are OFF. Also, for the scatter plot where each series has a different symbol, those are also changing and following the color as they move.
Let me know.
Thanks
Paul Belleville
-
- Posts: 2
- Joined: Wed Dec 12, 2007 1:05 pm
-
- Posts: 2
- Joined: Wed Dec 12, 2007 1:05 pm
Hi guys, after tracing through the source code (somewhat unnecessarily), you can actually set the SeriesRenderingOrder for your plot by doing this:
Hope that helps,
Rohit
Code: Select all
xyplot.removeLegend();
xyplot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD);
Rohit