Advertisement
KodingKid

Making a basic graph in C#

Apr 12th, 2021
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. protected void CalcDataGraphs()
  2. {
  3.     this.SuspendLayout();
  4.     display.DataSources.Clear();
  5.     display.SetDisplayRangeX(1, 500);
  6.     for (int j = 0; j < NumGraphs; j++)
  7.     {
  8.         display.DataSources.Add(new DataSource());
  9.         display.DataSources[j].Name = "Line Graph " + (j + 1);
  10.         display.DataSources[j].OnRenderXAxisLabel += RenderXLabel;
  11.         switch (CurExample)
  12.         {
  13.             case  "Basic":
  14.                 this.Text = "Basic Graph";
  15.                 display.DataSources[j].Length = 5000;
  16.                 display.PanelLayout = PlotterGraphPaneEx.LayoutMode.NORMAL;
  17.                 display.DataSources[j].AutoScaleY = false;
  18.                 display.DataSources[j].SetDisplayRangeY(-500, 500);
  19.                 display.DataSources[j].SetGridDistanceY(200);
  20.                 display.DataSources[j].OnRenderYAxisLabel = RenderYLabel;
  21.                 CalcSinusFunction_0(display.DataSources[j], j);
  22.                 break;
  23.                  }
  24.     }
  25.     ApplyColorSchema();
  26.     this.ResumeLayout();
  27.     display.Refresh();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement