Example #1
0
 public static GraphPane AddPanel(this ZedGraphControl zgcGraph)
 {
   var result = new GraphPane();
   zgcGraph.MasterPane.Add(result);
   zgcGraph.AxisChange();
   return result;
 }
Example #2
0
        public static void Graph(this ZedGraphControl zed, Function f,
            double a, double b, double h, Color c)
        {
            PointPairList list = new PointPairList();
            for (double x = a; x <= b; x += h)
            {
                list.Add(x, f(x));

                zed.GraphPane.AddCurve("", list, c, SymbolType.None);

                zed.AxisChange();
            }
        }
Example #3
0
    public static MasterPane InitMasterPanel(this ZedGraphControl zgcGraph, Graphics g, int graphCount, string title, PaneLayout pl = PaneLayout.SingleColumn)
    {
      MasterPane myMaster = zgcGraph.MasterPane;
      myMaster.PaneList.Clear();

      myMaster.Margin.All = 10;
      myMaster.InnerPaneGap = 10;

      // Set the master pane title
      myMaster.Title.Text = title;
      myMaster.Title.IsVisible = true;
      myMaster.Legend.IsVisible = false;

      for (int i = 0; i < graphCount; i++)
      {
        myMaster.Add(new GraphPane());
      }
      myMaster.SetLayout(g, pl);
      zgcGraph.AxisChange();
      return myMaster;
    }
Example #4
0
    public static void UpdateGraph(this ZedGraphControl zgc)
    {
      // Tell ZedGraph to calculate the axis ranges
      // Note that you MUST call this after enabling IsAutoScrollRange, since AxisChange() sets
      // up the proper scrolling parameters
      zgc.AxisChange();

      // Make sure the Graph gets redrawn
      zgc.Invalidate();
    }