public BasicSeriesData Make(SPCDetermineDataType sourcedata) { IList <double> items = sourcedata.Items; var param = sourcedata.Param; BasicSeriesData result = new BasicSeriesData(); SPCDetermineMethod method = new SPCDetermineMethod(sourcedata.UCL, sourcedata.LCL, sourcedata.Standard, sourcedata.Commands); result.Y.Add(sourcedata.Standard + sourcedata.UCL); result.Y.Add(sourcedata.Standard); result.Y.Add(sourcedata.Standard + sourcedata.LCL); result.X.Add(null); result.X.Add(null); result.X.Add(null); List <SPCCommandbase> excuteresult; double x = 0, y = 0; for (int i = 0; i < items.Count; i++) { y = items.ElementAt(i); excuteresult = method.Excute(y); x++; result.X.Add(x.ToString()); result.Y.Add(y); foreach (var command in excuteresult) { result.X.Add(null); result.Y.Add(command.ID); } } return(result); }
public void Draw(BasicSeriesData data, System.Drawing.Color color, DevExpress.XtraCharts.ChartControl drawBoard) { DrawBoard = drawBoard; Series = new DevExpress.XtraCharts.Series[2]; string pre = ""; for (int i = 0; i < 2; i++) { Series[i] = new DevExpress.XtraCharts.Series(); Series[i].View = DrawBoard.Series[i].View.Clone() as DevExpress.XtraCharts.SeriesViewBase; Series[i].CrosshairLabelPattern = DrawBoard.Series[i].CrosshairLabelPattern; Series[i].View.Color = color; Series[i].ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; DrawBoard.Series.Add(Series[i]); Series[i].Points.BeginUpdate(); Series[i].Points.Clear(); } (drawBoard.Diagram as DevExpress.XtraCharts.XYDiagram2D).GetAllAxesY()[0].ConstantLines.Add(new DevExpress.XtraCharts.ConstantLine("UCL", data.Y[0]) { Color = color }); (drawBoard.Diagram as DevExpress.XtraCharts.XYDiagram2D).GetAllAxesY()[0].ConstantLines.Add(new DevExpress.XtraCharts.ConstantLine("STD", data.Y[1]) { Color = color }); (drawBoard.Diagram as DevExpress.XtraCharts.XYDiagram2D).GetAllAxesY()[0].ConstantLines.Add(new DevExpress.XtraCharts.ConstantLine("LCL", data.Y[2]) { Color = color }); for (int i = 3; i < data.X.Count; i++) { var x = data.X[i]; if (x == null) { Series[1].Points.Add(new DevExpress.XtraCharts.SeriesPoint(pre, data.Y[i])); } else { Series[0].Points.Add(new DevExpress.XtraCharts.SeriesPoint(x, data.Y[i])); pre = x; } } for (int i = 0; i < 2; i++) { Series[i].Points.EndUpdate(); } }
public void InitData(SourceDataType sourceData) { this.SeriesData = this.SeriesMaker.Make(sourceData); }