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
Click Chart to get Series Value
Hi Matt,
you can use the CalcXPosValue and CalcYPosValue methods :
showmessage( inttostr(Chart1.Axes.Left.CalcYPosValue(Y)));
showmessage( inttostr(Chart1.Axes.Left.CalcXPosValue(X)));
Also, I've posted one example which could be usefull for you into the steema.public.attachments newsgroup ( at news://berneda.com ). It shows how to get the XYValues of the Series using a line like a cursor.
you can use the CalcXPosValue and CalcYPosValue methods :
showmessage( inttostr(Chart1.Axes.Left.CalcYPosValue(Y)));
showmessage( inttostr(Chart1.Axes.Left.CalcXPosValue(X)));
Also, I've posted one example which could be usefull for you into the steema.public.attachments newsgroup ( at news://berneda.com ). It shows how to get the XYValues of the Series using a line like a cursor.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Steve,
yes, you should be able to do the same using the Cursor tool.
yes, you should be able to do the same using the Cursor tool.
Pep Jorge
http://support.steema.com
http://support.steema.com