zed_graph (graphs) c#



  •  for (int i = 0; i < 3; i++)
                {
                    List[i] = new PointPairList();
                    tmp = DataY[i];
                    for (int j = 0; j < t.Length; j++)
                    {
                        tmp[i] = DataY[i][j];
                        current_date = start_date.AddDays(j);
                        List[i].Add(new XDate(current_date), tmp[j]);
                    }
                    curve[i] = pane.AddCurve("", List[i], Color.FromArgb(255, R[i], G[i], B[i]), SymbolType.Circle);
                    //List = null;
                }
    

    I'm real, I'm making curves (3 grand).

    Then I add them to pane. (This is class GraphPane)
    How am I supposed to remove these schedules?

    removes like this. curve[1].Clear();

    But I have to remove them from another function ( (this is the event of the clavice being pressed). How do that happen?



  • Method Clear() just purifies the points at the object of the curve.Curve) _ Curve remains on the panel list.CurveListthat is, the curve is not removed, it's just empty - has no points.

    To remove the curve, one method shall be required on the curve list. Remove/RemoveAt♪ Like this:

    private void button1_Click(object sender, EventArgs e) {
        CurveItem curve = GetCurve(); // Метод, который получает нужную кривую. Здесь Ваша логика.
        zedGraph.GraphPane.CurveList.Remove(curve);
        zedGraph.Invalidate();
    }
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2