TCursortool.Yvalue

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Heiko
Newbie
Newbie
Posts: 6
Joined: Thu Apr 13, 2006 12:00 am

TCursortool.Yvalue

Post by Heiko » Sat Apr 28, 2007 9:09 am

Hello,

I can read out the vertical position of a horizontal Cursortool by

Code: Select all

TCursortool.YValue
in scales of the axis.

But which axis does this refer to if I have more then one?

In my example I normally have a left and a right vertical axis and I want to read out both YValues of my horizontal Cursor tool.

How can I do this?

Greetings,
Heiko

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Apr 30, 2007 8:14 am

Hi Heiko,

Here's an example of how you can show Y values from both left and right axis using OnMouse event instead of Cursor Tool.

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  Chart1.Title.Caption := 'LeftAxis Y: ' + floattostr(Chart1.Axes.Left.CalcPosPoint(Y)) + '  RightAxis Y: ' + floattostr(Chart1.Axes.Right.CalcPosPoint(Y));
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Heiko
Newbie
Newbie
Posts: 6
Joined: Thu Apr 13, 2006 12:00 am

Difference between two CursorTools

Post by Heiko » Sat May 12, 2007 8:14 am

Thanks for the answer. But I think this doesn't help me?

I want (as an example) to get the difference between two horizontal CursorTools. Both in measures of the left and right axis.
This, whenever I move one of the two CursorTools.

For the left axis this is no problem:

Code: Select all

CursorTool.YValue
But what do I have to do with my right axis?

Heiko

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon May 14, 2007 9:31 am

If you want the difference between the YValues from Cursor Tools associated to different series (associated to different axes) you can simply calculate it but that'll be a difference between values from different scales.
You can also calculate the YValue of a cursor tool for another axis (not associated) like this:

Code: Select all

Chart1.Title.Caption := 'RightAxis Y: ' + floattostr(Chart1.Axes.Right.CalcPosPoint(Chart1.Axes.Left.CalcYPosValue(Cursor1.YValue)));
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply