Change the render of specific points in a serie

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Vegeta456
Posts: 1
Joined: Tue Feb 03, 2015 9:57 am
antibot: No, of course not.

Change the render of specific points in a serie

Post by Vegeta456 » Tue Feb 03, 2015 10:05 am

Hello, i am using jFreechart for several weeks now ;-)

This library is really good! I have a problem. Is it possible to change the render of a serie if a find specific values (X and Y). I don't want to change the render of all the values, but only some points.

I am working with XYSeries.

Thank you for your help, because i am lost :-(

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Change the render of specific points in a serie

Post by paradoxoff » Mon Feb 09, 2015 3:11 pm

You can subclass the renderer that your are noww using and override getItemOutlinePaint(int row, int column), getItemOutlineStroke(int row, int column), getItemPaint(int row, int column), getItemShape(int row, int column) and getItemStroke(int row, int column) to return paints, shapes and strokes that you want.
Note that this approach cannot be used to hide/show lines connecting the data points, or to change the "item rendering" in a more fundamental way, such as switching between a line renderer, bar renderer, and area renderer.

Locked