import com.imsl.chart.*; import com.imsl.chart.qc.*; public class SampleCChartOmit extends JFrameChart { static final 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 final 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 = getChart(); AxisXY axis = new AxisXY(chart); CChart censoredCChart = new CChart(axis, censoredNumberDefects); double lcl = censoredCChart.getLowerControlLimit().getValue()[0]; double center = censoredCChart.getCenter(); double ucl = censoredCChart.getUpperControlLimit().getValue()[0]; censoredCChart.remove(); double x[] = new double[furtherNumberDefects.length]; for (int i = 0; i < x.length; i++) { x[i] = SampleCChart.numberDefects.length + i; } CChart fullCChart = new CChart(axis, furtherNumberDefects); fullCChart.getControlData().setX(x); fullCChart.getLowerControlLimit().setValue(lcl); fullCChart.getCenterLine().setValue(center); fullCChart.getUpperControlLimit().setValue(ucl); axis.getAxisX().getAxisTitle().setTitle("Sample Number"); axis.getAxisX().getAxisLabel().setTextFormat("0"); axis.getAxisY().getAxisTitle().setTitle("Number Defective"); } public static void main(String argv[]) { new SampleCChartOmit().setVisible(true); } }