Mouse Event

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Vijaya Natarajan

Mouse Event

Post by Vijaya Natarajan » Tue Dec 19, 2000 3:30 am

Hi,
Is there a way to catch the mouseEvent in the chart.
Suppose, when the user clicks on the "Category1", I want
to do something, say, open up a window with more info
about it.
Thanks.
Sincerely,
Viji

David Gilbert

RE: Mouse Event

Post by David Gilbert » Tue Dec 19, 2000 6:40 am

Hi Viji,

You could add code to JFreeChartPanel to capture mouse events. The hard part would be to figure out which part of the chart was clicked on, since the relative size of all the pieces of the chart depend on a lot of variables (font sizes, labels, axis ranges, etc.)

I've added this to the list of enhancement requests for JFreeChart. You can view the current list in the Task Manager on SourceForge - http://sourceforge.net/projects/jfreechart. The task id is 23614.

Regards,

DG.

Locked