JMSL Chart Programmer's Guide
Quality Control and Improvement Charts >> NpChart  Previous Page  Contents  Next Page

NpChart

NpChart is similar to PChart, except that the number of defects per sample is plotted, not the sample rate. The position of the control limits are given by

where n is the number of items and p is the proportion of defective items.

NpChart Example

This example uses the orange juice can manufacturing data used earlier in the PChart example. In this example, the number of defects, rather than the defect rate is plotted.

(Download Code)
import com.imsl.chart.*;
import com.imsl.chart.qc.*;

public class SampleNpChart extends JFrameChart {     
    public SampleNpChart() {
        Chart chart = getChart();
        AxisXY axis = new AxisXY(chart);
        NpChart npchart = 
            new NpChart(axis, SamplePChart.sampleSize, 
                              SamplePChart.numberDefects);
        
        axis.getAxisX().getAxisTitle().setTitle("Sample Number");
        axis.getAxisX().getAxisLabel().setTextFormat("0");
        axis.getAxisY().getAxisTitle().setTitle("Number Defective");
    }
    
    public static void main(String argv[]) {
        new SampleNpChart().setVisible(true);
    }
}



©  Visual Numerics, Inc.  All rights reserved.  Previous Page  Contents  Next Page