CrossHair and multiple timeSeries

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
laurent b
Posts: 7
Joined: Fri Apr 27, 2007 5:43 am

CrossHair and multiple timeSeries

Post by laurent b » Fri Jun 22, 2007 9:36 am

Hi,
I have a dataset which is a TimeSeriesCollection. I have a crosshair which locks on the nearest point (another nice thing of this powerful lib).
After the ChartProgressListener finish drawing I would like to know on which serie is crosshair lock ?
I know I can use the getDomainCrosshairValue() and getRangeCrosshairValue to get the crossHair coordinates and then go through my internal data and find the good serie, but it seems a little overkill if the serie is already known.

Is there a fast way to get the serie index ?

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 » Fri Jun 22, 2007 9:45 am

Unfortunately, no dataset or series index info is retained, so there isn't an easy way to access it. That's an oversight, but unfortunately fixing the problem looks like a big chunk of work.
David Gilbert
JFreeChart Project Leader

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

laurent b
Posts: 7
Joined: Fri Apr 27, 2007 5:43 am

Post by laurent b » Fri Jun 22, 2007 9:58 am

ok,
thanks David for the quick answer.

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Fri Oct 12, 2007 3:31 pm

Simple algorithm/patch/source code available at following link:
http://www.jfree.org/phpBB2/viewtopic.php?p=64888#64888

Locked