How to show the series data when the mouse is point to Series lists?
I develop windows based application Using C#.Net, and includes the TChart component into the form - named it as ImagesChart. I raise MouseEnter Event in ImagesChart to show the series data as below code, but the program return nothing for valueindex, and the label show nothing.
private void ImagesChart_MouseEnter(object sender, System.EventArgs e)
{
int valueIndex=-1;
Steema.TeeChart.TChart tmp;
tmp= (Steema.TeeChart.TChart) sender;
valueIndex= tmp.Clicked(ImagesChart.PointToClient(Cursor.Position));
if (valueIndex != -1 )
{
headerValue = ImagesChart.Series[0].YValues[valueIndex].ToString ();
}
lblCurrentValue.Text = headerValue;
}
please advise the correct way to get the series data when the mouse over the series chart.
Thanks
Get Help For MouseEnter Event
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi -
Try:please advise the correct way to get the series data when the mouse over the series chart.
Code: Select all
private void Form1_Load(object sender, System.EventArgs e) {
bar1.FillSampleValues();
}
private void tChart1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {
int clicked = bar1.Clicked(e.X,e.Y);
if(clicked!=-1) tChart1.Header.Text = bar1.YValues[clicked].ToString();
else tChart1.Header.Text = "NONE";
}
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/