Hello,
How can I change the color of the stacked bars, at the moment it is red and blue, I would like to change to green and red.
Any help is highly appreciable.
Thanks
Changing color of Stacked Bar
Changing color of Stacked Bar
For every different series in the chart, you see a diiferent colored bar. So, if there are two series then their colors would be Blue and Red by default.
Changing this default setting is simple,
eg, if you are using a CategoryPlot to draw a stacked bar chart, then
Hope this must help,
Nitin
Changing this default setting is simple,
eg, if you are using a CategoryPlot to draw a stacked bar chart, then
Code: Select all
//get the renderer from CategoryPlot
CategoryItemRenderer r = plot.getRenderer();
//set a different color for each series
r.setSeriesPaint(0, Color.Green);
r.setSeriesPaint(1, Color.Gray);
//...
Nitin