Dynamically displaying x,y values

TeeChart for ActiveX, COM and ASP
Post Reply
Serge
Newbie
Newbie
Posts: 6
Joined: Thu Nov 13, 2003 5:00 am

Dynamically displaying x,y values

Post by Serge » Wed Apr 28, 2004 2:06 pm

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Thu Apr 29, 2004 7:24 am

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.
Try something similar to:

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/

Serge
Newbie
Newbie
Posts: 6
Joined: Thu Nov 13, 2003 5:00 am

Post by Serge » Wed May 05, 2004 2:16 pm

Thanks, much appreciated

Post Reply