Hi,
How can I dynamically (as the cursor is moved over the chart) display the values of the x and y points values in a text block on the chart. An example would be much appreciated.
Thanks,
Serge
Dynamically displaying x,y values
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi --
Try something similar to:How can I dynamically (as the cursor is moved over the chart) display the values of the x and y points values in a text block on the chart. An example would be much appreciated.
Code: Select all
private void Form1_Load(object sender, System.EventArgs e) {
points1.FillSampleValues();
annotation1.Active=false;
}
private void tChart1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {
int clicked = points1.Clicked(e.X,e.Y);
if(clicked!=-1){
annotation1.Active=true;
annotation1.Text = "XValue: " + points1[clicked].X.ToString() + " YValue: " + points1[clicked].Y.ToString();
}
else {
annotation1.Active=false;
}
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/