public GraphControlUI() { InitializeComponent(); m_graph.SetLabels("Test Graph", "X Axis", "Y Axis"); m_graph.BorderStyle = BorderStyle.FixedSingle; Add("Sine Wave", 1000 , i => { var x = i * Math_.Tau / 1000.0; var y = Math.Sin(x); return(new { X = x, Y = y, ErrLo = 0, ErrHi = 0 }); } , new GraphControl.Series.RdrOptions { PlotType = GraphControl.Series.RdrOptions.EPlotType.Line, LineWidth = 2f, LineColour = Color.Blue, PointSize = 0, }); Add("Cosine Wave", 1000 , i => { var x = i * Math_.Tau / 1000.0; var y = Math.Cos(x); return(new { X = x, Y = y, ErrLo = 0, ErrHi = 0 }); } , new GraphControl.Series.RdrOptions { PlotType = GraphControl.Series.RdrOptions.EPlotType.Line, LineWidth = 2f, LineColour = Color.Red, PointSize = 0, }); Add("Points", 1000 , i => { var x = i * Math_.Tau / 1000.0; var y = Math.Cos(x) * Math.Sin(x); var errlo = Math.Abs(0.1 * Math.Cos(x - Math_.TauBy16)); var errhi = Math.Abs(0.1 * Math.Cos(x + Math_.TauBy16)); return(new { X = x, Y = y, ErrLo = -errlo, ErrHi = +errhi }); } , new GraphControl.Series.RdrOptions { PlotType = GraphControl.Series.RdrOptions.EPlotType.Point, PointColour = Color.Green, PointSize = 2f, }); Add("Bars", 10 , i => { var x = i + 10; var y = i; // * Math.Sin(i * Math_.Tau / 1000.0); return(new { X = x, Y = y, ErrLo = 0, ErrHi = 0 }); } , new GraphControl.Series.RdrOptions { PlotType = GraphControl.Series.RdrOptions.EPlotType.Bar, PointSize = 0, BarColour = Color.SteelBlue, }); m_graph.FindDefaultRange(); m_graph.ResetToDefaultRange(); m_graph.AddOverlayOnPaint += OverlayOnPaint; m_graph.AddOverlayOnRender += OverlayOnRender; }