Get Help For MouseEnter Event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Web
Newbie
Newbie
Posts: 4
Joined: Wed Mar 31, 2004 5:00 am

Get Help For MouseEnter Event

Post by Web » Tue Oct 26, 2004 1:15 pm

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

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 » Fri Oct 29, 2004 10:10 am

Hi -
please advise the correct way to get the series data when the mouse over the series chart.
Try:

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/

Post Reply