public void AddCurveToPlot(Stats dataClass, int Length, string label, Color crveColor) { EventHandler method = null; try { this._myMainXaxisData = new double[Length]; for (int i = 0; i < Length; i++) { this._myMainXaxisData[i] = dataClass.DataList[i]; } this._curveColor = crveColor; this._curveLabel = label; if (this._myMainXaxisData.Length > 0) { Stats stats = new Stats(); double[] y = new double[this._myMainXaxisData.Length]; for (int j = 0; j < this._myMainXaxisData.Length; j++) { y[j] = (j + 1) * (1.0 / ((double) this._myMainXaxisData.Length)); } stats.SortArray(this._myMainXaxisData.Length, this._myMainXaxisData); this._myMainPane.AddCurve(this._curveLabel, this._myMainXaxisData, y, this._curveColor, SymbolType.Circle); this._myMainPane.AxisChange(); if (method == null) { method = delegate { this.zedGraphControl1.Refresh(); this.zedGraphControl1.Update(); }; } base.Invoke(method); } } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
public void CreateChart(ZedGraphControl zgc) { EventHandler method = null; this._myMainPane.YAxis.MajorGrid.IsVisible = true; this._myMainPane.YAxis.MinorGrid.IsVisible = true; this._myMainPane.CurveList.Clear(); this._myMainPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45f); this._myMainPane.Title.Text = this._reportTitle; this._myMainPane.XAxis.Title.Text = "Data"; this._myMainPane.YAxis.Title.Text = "Probability"; this._myMainPane.YAxis.Scale.MaxAuto = false; this._myMainPane.YAxis.Scale.MinAuto = false; this._myMainPane.YAxis.Scale.Max = 1.0; this._myMainPane.YAxis.Scale.Min = 0.0; if ((this._myMainXaxisData != null) && (this._myMainXaxisData.Length > 0)) { Stats stats = new Stats(); double[] y = new double[this._myMainXaxisData.Length]; for (int i = 0; i < this._myMainXaxisData.Length; i++) { y[i] = (i + 1) * (1.0 / ((double) this._myMainXaxisData.Length)); } stats.SortArray(this._myMainXaxisData.Length, this._myMainXaxisData); this._myMainPane.AddCurve(this._curveLabel, this._myMainXaxisData, y, this._curveColor, SymbolType.Diamond); this._myMainPane.AxisChange(); if (method == null) { method = delegate { zgc.Update(); zgc.Refresh(); }; } base.Invoke(method); } zgc.Size = new Size(base.ClientRectangle.Width - 0x19, base.ClientRectangle.Height - 0x2d); }