0

This should be a quick question, but I was wondering how I would make the line color different from points in JFreeChart. I'm using an XYLineAndShapeRenderer and I make getItemPaint(int,int) custom to look at a List to determine the color of each point. However when I make it so that all the points are the same color in the beginning, it makes it so that the line is the same color as all the points (Color.GREEN), but I would like it to be blue (Color.BLUE).

Thank you in advance.

Edit: I noticed now that when I update a single point it change the line before it to be that color, which I don't want. How do I keep the line and point colors seperate? enter image description here

Sam
  • 405
  • 2
  • 5
  • 13
  • Please edit your question to include a [complete example](http://stackoverflow.com/help/mcve) that exhibits the approach illustrated, for [example](http://stackoverflow.com/a/9875534/230513). – trashgod Oct 28 '14 at 21:55

1 Answers1

0

By default the shapes are drawn using the seriesPaint, but there are two flags useFillPaint and useOutlinePaint that you can set to have the shapes filled and outlined with the colours defined for the fill and outline. There is some info in the Javadocs:

http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.html

David Gilbert
  • 4,427
  • 14
  • 22