none
how to delete or remove a point in MSCHART C# RRS feed

  • General discussion

  • I would like to remove a point in mschart on a tangent graph. This means i need to remove an x and y value everytime the period = the domain. I have the math done correctly but now i need to remove those points. Here is the code for the tangent graph. It doesnt include the button to place the points on the chart.

      private void tan()
            {
                chart1.Series["xxx"].IsXValueIndexed = true;
                //loop till pointTan draws 10 values 
                for (int pointTan = 0; pointTan <= 10; pointTan++)
                {
                    //declare vairaibles
                    double kTR;
                    double dTR;
                    double domain;
                    double periodT = 0;
                    double n = 0;
    
                    //incrment aymptote number
                    n++;
    
                    //convert to radians
                    kTR = ((kT * Math.PI) / 180);
                    dTR = ((dT * Math.PI) / 180);
    
                    if (kTR == 0)
                    {
                        periodT = periodT + (Math.PI /2);
                    }
                    else
                    {
                        periodT = ((2 * Math.PI) / kTR);
                    }
    
                    //find asymptotes
                    domain = (((2 * n) - 1) * Math.PI) / 2;
                   
                    label1.Text = periodT.ToString();
    
                    //find theta
                    double xT = Convert.ToDouble(x);
                    double theta = (kTR * (xT + dTR));
                    
                    if (theta == 0)
                    {
                       //label1.Text = "matt";
                       theta = xT + dTR;
                    }
                    
                    //convert y value to double
                    double yT = Convert.ToDouble(y);
    
                    yT = ((aT * (Math.Tan(theta)) + cT));
    
                   int xP = Convert.ToInt32(x);
                   int yP = Convert.ToInt32(yT);
                    
                    //tell the chart to stop drawing
                    if (periodT == domain)
                    {
                        chart1.Series.;
                        chart1.Series["xxx"].Points[yP].IsEmpty = true;
                        label1.Text = "matt";
                    }
                    
                        //draw the tan function
                        chart1.Series["xxx"].Points.AddXY(xP, yP);
                    
                    //increment x value
                    x++;
                }
               x = -5;
    Thursday, January 3, 2013 3:51 PM

All replies