Hi,
I am using jfreechart to plot line charts. I realise that if I was ploting 2 lines that have identical values (for e.g, line 1 of red color and line 2 of blue color), the two lines seems to merge to form purple color on the chart. Is there any way to aviod this? For example, only one of the color is shown?
Thanks a lot...
northstar
Colors of lines in line chart
RE: Colors of lines in line chart
Hi,
I use the book "Java 2D Graphics" by Jonathan Knudsen. In the section on Compositing, it talks about the different compositing rules that you can use. In JFreeChart, I didn't even think about this, just used the default (which I think is AlphaComposite.SrcOver). Anyway, you should try adding a line of code in the draw method of the plot you are using:
g2.setComposite(AlphaComposite.Src);
I haven't tried it myself though...
Regards,
DG.
I use the book "Java 2D Graphics" by Jonathan Knudsen. In the section on Compositing, it talks about the different compositing rules that you can use. In JFreeChart, I didn't even think about this, just used the default (which I think is AlphaComposite.SrcOver). Anyway, you should try adding a line of code in the draw method of the plot you are using:
g2.setComposite(AlphaComposite.Src);
I haven't tried it myself though...
Regards,
DG.