XYPlot click event & key events

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
m3stevep
Posts: 13
Joined: Sun Oct 22, 2006 2:42 am
Location: UTAH, USA
Contact:

XYPlot click event & key events

Post by m3stevep » Tue Oct 31, 2006 10:04 am

Is there a way to tie the arrow keys to iterate through graph plots?

Similar to the side effect of the slider in 'Crosshair Demo 1'.

I could just use the slider, but I'm having a hard time figuring out how to find out what item in the dataset I've selected. The slider is tied to the dataset.getItemCount(0). The slider doesn't get updated by clicking on the graph.

Any help would be much appreciated!

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

Post by david.gilbert » Tue Oct 31, 2006 3:08 pm

It's not something that is implemented specifically. Swing is pretty flexible, though, so I'm sure there would be some way to capture the key events for the ChartPanel and wire them up to update the cross-hairs in the chart.

It wouldn't be that hard to update the slider in the demo you mentioned - the table gets updated after a click on the chart, it would be simple to add one or two lines to update the slider value as well...I should probably make that change.
David Gilbert
JFreeChart Project Leader

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

Locked