Changing the color and shape of one data item in Jfreechart.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
manjusha0110
Posts: 10
Joined: Tue May 02, 2017 7:24 am
antibot: No, of course not.

Changing the color and shape of one data item in Jfreechart.

Post by manjusha0110 » Mon Jul 03, 2017 7:43 am

Hi,

Can someone please let me know if it is possible to change the color and shape of one data item in jfreechart?. My scearnio is i am selecting one of the data points and marking it as ignore, so that i don't consider it for my calculations. I want to visually also show that the particular point is marked as ignore hence need to change the color and shape....Please help me...its urgent.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Changing the color and shape of one data item in Jfreech

Post by david.gilbert » Mon Jul 03, 2017 10:07 pm

Yes you can do this. You need to determine which renderer class is being used, and create subclass of it where you override the getItemShape() and getItemPaint() methods to return a specific shape and color for the data item that you wish to highlight (or de-emphasise, depending on your requirement).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

manjusha0110
Posts: 10
Joined: Tue May 02, 2017 7:24 am
antibot: No, of course not.

Re: Changing the color and shape of one data item in Jfreech

Post by manjusha0110 » Fri Jul 07, 2017 9:36 am

Thanks david.

Locked