Pareto Chart

A ParetoChart is a frequency distribution of attribute data. The bars are ordered by the number of defects, with the attribute category having the largest number of defects appearing first.

There is an option to add a cumulative percentage line to the chart. This is the per­cent of defects accounted for by the current item and all items to its left. If the cumulative percentage line is added, a second axis is created on the right represent­ing the cumulative percentage from 0% to 100%. The units of the original axis, which always appear on the left, represent the number of defects, 36.

ParetoChart Example

The number of defects attributable to 1 of 19 of a variety of causes was collected (Montgomery 179). In this example, the “Incorrect dimensions” defect category has the largest number of defects, 36.

(Download Code)

 

import com.imsl.chart.*;

import com.imsl.chart.qc.*;

 

public class SampleParetoChart extends JFrameChart {

    static final String labels[] = {

        "Parts damaged",

        "Machining problems",

        "Supplied parts rusted",

        "Masking insufficient",

        "Misaligned weld",

        "Processing out of order",

        "Wrong part issued",

        "Unfinished fairing",

        "Adhesive failure",

        "Powdery alodine",

        "Paint out of limits",

        "Paint damaged by etching",

        "Film on parts",

        "Primer cans damaged",

        "Voids in casting",

        "Delaminated composite",

        "Incorrect dimensions",

        "Improper test procedure",

        "Salt-spray failure"

    };

    static final int numberDefects[] = {

        34, 29, 13, 17, 2, 4, 3, 3, 6,

        1, 2, 1, 5, 1, 2, 2, 36, 1, 4

    };  

     

    public SampleParetoChart() {

        Chart chart = getChart();

        AxisXY axis = new AxisXY(chart);

        ParetoChart pareto = new ParetoChart(axis, labels, numberDefects);

       

        Data cumulativeLine = pareto.addCumulativeLine();

        cumulativeLine.setMarkerType(Data.MARKER_TYPE_FILLED_CIRCLE);

       

        pareto.setLabelType(pareto.LABEL_TYPE_Y);

        pareto.setTextFormat("0");

        pareto.setFillColor(java.awt.Color.blue);

        axis.getAxisX().getAxisLabel().setTextAngle(90);

       

        double vp[] = axis.getViewport();

        vp[0] = 0.1;

        vp[3] = 0.7;

        axis.setViewport(vp);

        cumulativeLine.getAxis().setViewport(vp);

    }

   

   

    public static void main(String argv[]) {

        new SampleParetoChart().setVisible(true);

    }

}

 

 

SampleParetoChart



Visual Numerics - Developers of IMSL and PV-WAVE
http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260