How to get the value of the right axis?
How to get the value of the right axis?
The value of the bottom and left axis of the cursor position can be obtained through the cursortool component.How can I get the value of the right axis of the cursor position.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to get the value of the right axis?
Hello,
please find following a short code snippet which hopefully shows you how this can be done:
please find following a short code snippet which hopefully shows you how this can be done:
Code: Select all
private void InitializeTChart(TChart chart)
{
void CursorTool_Change(object sender, CursorChangeEventArgs e)
{
chart.Header.Text = $"YValue {e.YValue}";
chart.Header.Text += $" Right axis {chart.Axes.Right.CalcPosPoint(e.y)}";
}
var line1 = new Line(chart.Chart);
var line2 = new Line(chart.Chart);
line1.VertAxis = VerticalAxis.Left;
line2.VertAxis = VerticalAxis.Right;
var rnd = new Random();
for (int i = 0; i < 20; i++)
{
var val = rnd.Next(0, 100);
line1.Add(val);
line2.Add(val * 100);
}
var cursorTool = new CursorTool(chart.Chart);
cursorTool.FollowMouse = true;
cursorTool.Change += CursorTool_Change;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |