Page 1 of 1

Annotations and y-axis

Posted: Tue Jul 30, 2013 2:08 pm
by 13051032
1. Is it possible to cancel the mouse move option to annotations?
2. Is it possible to change the y-axis setrange() while double_Clicking on the y-axis?

Re: Annotations and y-axis

Posted: Wed Jul 31, 2013 9:38 am
by 10050769
Hello asupriya,
1. Is it possible to cancel the mouse move option to annotations?
You can make that in chart nothing is done when the mouse is over in the annotation tool. You can do something as I have made in next example of code in MouseMove event:

Code: Select all

 void tChart1_MouseMove(object sender, MouseEventArgs e)
    {
       if (!(an1.Shape.Left< e.X &&  e.X < an1.Shape.Right) )
      {
        if (!(an1.Shape.Top < e.Y && e.Y < an1.Shape.Bottom))
        {
          an1.Text = "Hello";
          tChart1.Header.Text = e.X.ToString() + "," + e.Y.ToString();
        }
      }
2. Is it possible to change the y-axis setrange() while double_Clicking on the y-axis?
In this case you need use in AxisClick Event the SetMinMax() to change the scale of left axis as you want. For example, you can do something as next:

Code: Select all

void tChart1_ClickAxis(object sender, MouseEventArgs e)
    {
      tChart1.Axes.Left.SetMinMax(tChart1.Axes.Left.Minimum + 10, tChart1.Axes.Left.Maximum); 
    }
Could you tell us if previous codes help you to achieve as you want?

I hope will helps.

Thanks,