Mouse click handler for axes

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
plusik
Posts: 28
Joined: Tue May 16, 2006 3:36 am
Location: Boston, MA, USA

Mouse click handler for axes

Post by plusik » Wed Feb 24, 2016 5:45 pm

Hi,

I am using JFreeChart with XYPlot with a NumberAxis on both X and Y axes.

Using the JavaFX ChartViewer, when I click on the Y axis it seems to do full zoom out (set auto range to both axes). Clicking on the X axis has no effect. AFAIK clicking on any axis had no effect in the Swing version.

I think it would be great to add a default handler that would set the auto range to each axis (separately) when the user clicks on the axis.

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

Re: Mouse click handler for axes

Post by david.gilbert » Thu Feb 25, 2016 10:39 pm

I hadn't noticed this behaviour before. It looks like a bug...but I agree with you that it would be useful to enable some kind of mouse interaction directly on the axes. Not sure I'll get anything done for the upcoming release (other than fixing this bug) but I'll keep the feature in mind.
David Gilbert
JFreeChart Project Leader

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

plusik
Posts: 28
Joined: Tue May 16, 2006 3:36 am
Location: Boston, MA, USA

Re: Mouse click handler for axes

Post by plusik » Fri Mar 04, 2016 4:04 am

I tried to implement the function myself.
See https://github.com/jfree/jfreechart/pull/6

Locked