How to highlight The dataPoints Of A series ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
abinashparija
Posts: 8
Joined: Fri May 15, 2009 1:07 pm

How to highlight The dataPoints Of A series ?

Post by abinashparija » Fri May 15, 2009 1:26 pm

I am ploting XY Series plots in a JSp page ,Now i am able to use the tool tip feature of
JFreeChart.Now i want to highlight all the data points of a series once any of the points of the series is clicked

How to do this can any one suggest ?

Thanks in Advance

snoopygee
Posts: 18
Joined: Wed Jan 28, 2009 3:10 pm

Re: How to highlight The dataPoints Of A series ?

Post by snoopygee » Fri May 15, 2009 2:24 pm

There is no way to do this automatically, the chart does not supply this exact functionality by default.

The only way to do this is to identify the x, y values from the mouse event and manually draw a XYShapeAnnotation as a circle (or another shape) around each point you want to highlight. This of course means you have to save each point you want highlighted yourself and draw a new XYShapeAnnotation for each one.

snoopygee
Posts: 18
Joined: Wed Jan 28, 2009 3:10 pm

Re: How to highlight The dataPoints Of A series ?

Post by snoopygee » Fri May 15, 2009 2:28 pm

...just re-read your post. Just in case you mean that you want to change every single point in a series once you select only one of them, the easiest way to accomplish this is to reset the parameters of the actual series renderer such as:

renderer.setSeriesShape
renderer.setSeriesPaint

abinashparija
Posts: 8
Joined: Fri May 15, 2009 1:07 pm

Re: How to highlight The dataPoints Of A series ?

Post by abinashparija » Fri May 15, 2009 4:34 pm

snoopygee wrote:There is no way to do this automatically, the chart does not supply this exact functionality by default.

The only way to do this is to identify the x, y values from the mouse event and manually draw a XYShapeAnnotation as a circle (or another shape) around each point you want to highlight. This of course means you have to save each point you want highlighted yourself and draw a new XYShapeAnnotation for each one.

I am Actually new To JFree Chart Can You send a sample code supporting your comments ?

abinashparija
Posts: 8
Joined: Fri May 15, 2009 1:07 pm

Re: How to highlight The dataPoints Of A series ?

Post by abinashparija » Fri May 15, 2009 4:37 pm

snoopygee wrote:...just re-read your post. Just in case you mean that you want to change every single point in a series once you select only one of them, the easiest way to accomplish this is to reset the parameters of the actual series renderer such as:

renderer.setSeriesShape
renderer.setSeriesPaint


I guess it wil not heighlight the series coz,this code i will write in the java class but i want this dynamicity at the JSP page.
Where actually i am showing the plots

Locked