import com.imsl.chart.*; import com.imsl.chart.qc.*; public class SamplePChart extends JFrameChart { static final int sampleSize = 50; static final int numberDefects[] = { 12, 15, 8, 10, 4, 7, 16, 9, 14, 10, 5, 6, 17, 12, 22, 8, 10, 5, 13, 11, 20, 18, 24, 15, 9, 12, 7, 13, 9, 6 }; public SamplePChart() { Chart chart = getChart(); AxisXY axis = new AxisXY(chart); PChart pchart = new PChart(axis, sampleSize, numberDefects); pchart.getLowerControlLimit().setTitle("lcl = {0,number,0.00%}"); pchart.getCenterLine().setTitle("center = {0,number,0.00%}"); pchart.getUpperControlLimit().setTitle("ucl = {0,number,0.00%}"); axis.getAxisX().getAxisTitle().setTitle("Sample Number"); axis.getAxisX().getAxisLabel().setTextFormat("0"); axis.getAxisY().getAxisTitle().setTitle("Percent Defective"); axis.getAxisY().getAxisLabel().setTextFormat("percent"); } public static void main(String argv[]) { new SamplePChart().setVisible(true); } }