Click Chart to get Series Value
Posted: Wed Oct 13, 2004 8:07 pm
Let's say I have a chart and a TFastLineSeries.
I click on a coordinate on the *chart*, and I get an X and a Y value (MouseDown or MouseUp, whichever).
Nothing I've seen anywhere (searched for 'click' etc) seems to be able to tell me how I can associate the X coordinate of the mouse (whether it's been converted to the corresponding Axis value or not) with a ValueIndex so that I can do this:
ValueIndex: Integer;
Yvalue: Double;
...
ValueIndex := Series1.SomeFunctionHere(X);
Yvalue := Series1.YValues[ValueIndex];
I do not want to have to click on Series1, since it's thin. Yes, I could go searching around X,Y for a Series1.Clicked(X+dx,Y+dy) but this seems like it's unnecessary.
I'm using TeeChart7 for Delphi 7 if that makes a difference.
Maybe I'm missing something. But I'm quite frustrated now.
Can anyone fill in the missing blanks?
Thanks to all.
Regards,
Matt
I click on a coordinate on the *chart*, and I get an X and a Y value (MouseDown or MouseUp, whichever).
Nothing I've seen anywhere (searched for 'click' etc) seems to be able to tell me how I can associate the X coordinate of the mouse (whether it's been converted to the corresponding Axis value or not) with a ValueIndex so that I can do this:
ValueIndex: Integer;
Yvalue: Double;
...
ValueIndex := Series1.SomeFunctionHere(X);
Yvalue := Series1.YValues[ValueIndex];
I do not want to have to click on Series1, since it's thin. Yes, I could go searching around X,Y for a Series1.Clicked(X+dx,Y+dy) but this seems like it's unnecessary.
I'm using TeeChart7 for Delphi 7 if that makes a difference.
Maybe I'm missing something. But I'm quite frustrated now.
Can anyone fill in the missing blanks?
Thanks to all.
Regards,
Matt