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("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); } }