Jannis Alexakis
Jannis Alexakis

Reputation: 1319

OverlaidXYPlotDemo1 : Changing Series Color

I have managed to change the color of the bars in the OverlaidXYPlotDemo1, with :

XYItemRenderer xir = plot.getRenderer();
xir.setSeriesPaint(0, Color.BLUE);

However, I can´t change the color of the second series with

xir.setSeriesPaint(1, Color.GREY);

so I´m probably missing something. Any hints?

Upvotes: 1

Views: 146

Answers (1)

Jannis Alexakis
Jannis Alexakis

Reputation: 1319

I figured it out. The correct way to do this, is using the renderers:

renderer1.setSeriesPaint(0, Color.YELLOW);
renderer2.setSeriesPaint(0, Color.GREY);

Upvotes: 1

Related Questions