import com.imsl.chart.*; import com.imsl.chart.qc.PChart; public class PChartEx1 extends javax.swing.JApplet { static private final double defectRate[] = { 0.24, 0.3, 0.16, 0.2, 0.08, 0.14, 0.32, 0.18, 0.28, 0.2, 0.1, 0.12, 0.34, 0.24, 0.44, 0.16, 0.2, 0.1, 0.26, 0.22, 0.4, 0.36, 0.48, 0.3, 0.18, 0.24, 0.14, 0.26, 0.18, 0.12 }; static private final int sampleSize = 50; public void init() { Chart chart = new Chart(this); JPanelChart panel = new JPanelChart(chart); getContentPane().add(panel, java.awt.BorderLayout.CENTER); setup(chart); } static private void setup(Chart chart) { AxisXY axis = new AxisXY(chart); axis.getAxisY().getAxisTitle().setTitle("Defect Rate"); axis.getAxisY().getAxisLabel().setTextFormat("percent"); PChart pc = new PChart(axis, sampleSize, defectRate); } public static void main(String argv[]) { JFrameChart frame = new JFrameChart(); PChartEx1.setup(frame.getChart()); frame.setVisible(true); } }