Menu

Changing existing curve visibility ?

Help
MachoGrump
2005-05-18
2012-09-19
  • MachoGrump

    MachoGrump - 2005-05-18

    Hi,
    I am using C#.

    I have been trying to change an existing curve visibility using a form button and so far I have had no luck.

    The curve has already been generated and drawn from my Plot_Chart method.

    All the button does is either make the existing curve visible or invisible using a Click event.

    This is the button code I have been trying, but I get an System.ArgumentNullException error:

    private void TEST1(object sender,System.EventArgs e) //Button Click event to remove
    {
    MyChart.GraphPane.CurveList.Clear();
    }

    private void TEST2(object sender,System.EventArgs e) //Button Click event to show myCurve
    {
    MyChart.GraphPane.CurveList.Add(myCurve);
    }

    Any help will be appreciated, thankyou.

     
    • MachoGrump

      MachoGrump - 2005-05-18

      Thank you very much,

      MyChart.GraphPane.CurveList[0].IsVisible = false; worked great.

      It was even better once I figured (0) is for the very first list loaded, (1) for the second loaded etc...

      Thx for this great tool John.

       
    • John Champion

      John Champion - 2005-05-18

      Hi,
      Did you verify that MyChart is not null? Also, you can make a curve invisible with:

      MyChart.GraphPane.CurveList[0].IsVisible = false;

      in this way you don't actually have to delete it. You need to call the Invalidate() or Refresh() method to update the display after making this change.
      John

       

Log in to post a comment.

MongoDB Logo MongoDB