mouse clicks in jfreechart !

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
shekhar
Posts: 1
Joined: Fri Jul 06, 2012 2:16 pm
antibot: No, of course not.

mouse clicks in jfreechart !

Post by shekhar » Fri Jul 06, 2012 2:28 pm

Hi To All,

I am using JFreechart with netbeans to create a pie chart. I am creating chart in JSP and displaying it in image (html tag ). I have a requirement of displaying some details when click on a sector of Pie Chart. how can i achieve this.
Please help me.

Thanks in advance

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: mouse clicks in jfreechart !

Post by matinh » Mon Jul 09, 2012 8:15 am

Hi!

There is so direct support for this in JFreeChart, as your chart is just an image in a browser which doesn't know anything about JFreeChart. So you have to find a solution on the client-side. You could use image maps to divide your chart into regions (I thinks JFreeChart has some basic support for this, but it's been a while since I used it the last time). And you could use JavaScript events to catch click-events on the browser-side. Cewolf is a JSP base approach based on JFreeChart which also has some support for image maps. Maybe you could have a look at it.

hth,
- martin

Locked