Page 1 of 1

Get Help For MouseEnter Event

Posted: Tue Oct 26, 2004 1:15 pm
by 8124952
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

Posted: Fri Oct 29, 2004 10:10 am
by Chris
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";
    }