mouse listener?

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

mouse listener?

Post by Eric » Sat May 04, 2002 5:33 pm

It would be awesome to add support for mouse events...

like hover over a plotted element and have that call back to your mouselistener object and use that to highlight that element's data in an accompanying grid...

was that on the todo list at all? Is that something I could contribute if it isnt?

David Gilbert

Re: mouse listener?

Post by David Gilbert » Sat May 04, 2002 9:44 pm

Hi Eric,

I have some interesting code from Alex Weber for mouse events...I've been meaning to post it on the website in the contributions section, until I have it integrated into the main source tree for JFreeChart. I'll try to get that done as soon as possible (it may be Tuesday before I get it done as I'm away for the next couple of days).

Regards,

DG.

Eric

Re: mouse listener?

Post by Eric » Sun May 05, 2002 5:20 am

sweet, thanks

David Gilbert

Re: mouse listener?

Post by David Gilbert » Tue May 07, 2002 9:35 am

I've uploaded the file (1.4MB) to:

ftp://213.253.31.132/jfreechart/jfreech ... -aw.tar.gz

Hopefully I'll get time soon to repackage the files as a zip archive...

Regards,

DG.

Mudit Wahal

Re: mouse listener?

Post by Mudit Wahal » Sat May 11, 2002 6:52 pm

David,

Can this be extended to create lines on the charts ?

Thanks

Mudit

Eric

Re: mouse listener?

Post by Eric » Sat May 11, 2002 10:07 pm

I've taken a look at it and it doenst look like it will help you in that dept at all... all it really does is grant you the ability to register a click listener and be sent an object contaning data of the element you clicked.

Mudit Wahal

Re: mouse listener?

Post by Mudit Wahal » Sun May 12, 2002 5:46 pm

I created my own mouseListener and added to the JFreeChartPanel. I can draw the lines now. Only thing is when the chart refreshes, I lose all the line information. I somehow need to store the lines and redraw them when the chart refreshes. Any ideas where is the hook for that ?

Thanks
Mudit

Mudit Wahal

Re: mouse listener?

Post by Mudit Wahal » Mon May 13, 2002 3:43 am

I extended JFreeChartPanel and add my mouse listener and paintComponent in there. Done. Thanks.

Mudit

David Gilbert

Re: mouse listener?

Post by David Gilbert » Tue May 14, 2002 10:03 am

Hi All,

I have some code from Hans-Jurgen Greiner that I am working on at the moment...it introduces quite a bit of new code to JFreeChartPanel and will include zooming on a region selected with the mouse, cross hairs on the panel and a mouse listener mechanism.

Regards,

DG.

Locked