Hi bztom33,
I had some problems to find out myself how the axes, datasets and renderers collaborate!
Since you have a second axis, it is clear that you assigned (at least) a second dataset to your plot and mapped that to the "secondary axis".
If you have n datasets that you want to format independently, you have to assign n renderer to the plot! The integer index in the setXXX() methods of the renderer does not refer to all series of the plot, but only to the series of the dataset that has the same index as the renderer.
With your code
Code: Select all
renderer1.setSeriesPaint(1, Color.green); --not working secondary axis (right).
you are setting the color of the second series of that dataset that has the same index than the renderer1. But what you apparently want is to set the color of the first (and maybe only) series of the second dataset. Here is how this can be achieved
Code: Select all
plot.setDataset(1,yourDatasetAssignedToSecondaryAxis);
plot.setRenderer(1,aNewRenderer);
aNewRenderer.setSeriesPaint(0,Color.GREEN);