using Imsl.Chart2D; using Imsl.Chart2D.QC; public class SampleCChartOmit : FrameChart { static int[] numberDefects = { 21, 24, 16, 12, 15, 5, 28, 20, 31, 25, 20, 24, 16, 19, 10, 17, 13, 22, 18, 39, 30, 24, 16, 19, 17, 15 }; static int[] censoredNumberDefects = { 21, 24, 16, 12, 15, /*5,*/ 28, 20, 31, 25, 20, 24, 16, 19, 10, 17, 13, 22, 18, /*39,*/ 30, 24, 16, 19, 17, 15 }; static int[] furtherNumberDefects = { 16, 18, 12, 15, 24, 21, 28, 20, 25, 19, 18, 21, 16, 22, 19, 12, 14, 9, 16, 21 }; public SampleCChartOmit() { Chart chart = this.Chart; AxisXY axis = new AxisXY(chart); CChart censoredCChart = new CChart(axis, censoredNumberDefects); double lcl = censoredCChart.LowerControlLimit.GetValue()[0]; double center = censoredCChart.Center; double ucl = censoredCChart.UpperControlLimit.GetValue()[0]; censoredCChart.Remove(); double[] x = new double[furtherNumberDefects.Length]; for (int i = 0; i < x.Length; i++) { x[i] = numberDefects.Length + i; } CChart fullCChart = new CChart(axis, furtherNumberDefects); fullCChart.ControlData.SetX(x); fullCChart.LowerControlLimit.SetValue(lcl); fullCChart.CenterLine.SetValue(center); fullCChart.UpperControlLimit.SetValue(ucl); axis.AxisX.AxisTitle.SetTitle("Sample Number"); axis.AxisX.AxisLabel.TextFormat = "0"; axis.AxisY.AxisTitle.SetTitle("Number Defective"); } public static void Main(string[] argv) { System.Windows.Forms.Application.Run(new SampleCChartOmit()); } }