import com.imsl.chart.*; import com.imsl.chart.qc.*; public class SampleEWMA extends JFrameChart { static final double data[] = { 9.45, 7.99, 9.29, 11.66, 12.16, 10.18, 8.04, 11.46, 9.20, 10.34, 9.03, 11.47, 10.51, 9.40, 10.08, 9.37, 10.62, 10.31, 8.52, 10.84, 10.90, 9.33, 12.29, 11.50, 10.60, 11.08, 10.38, 11.62, 11.31, 10.52 }; public SampleEWMA() { Chart chart = getChart(); AxisXY axis = new AxisXY(chart); double lambda = 0.10; double mean = 10.0; double stdev = 1.0; EWMA ewma = new EWMA(axis, data, lambda, mean, stdev); ewma.getLowerControlLimit().setControlLimit(-2.7); ewma.getUpperControlLimit().setControlLimit(2.7); axis.getAxisX().getAxisTitle().setTitle("Sample Number"); axis.getAxisX().getAxisLabel().setTextFormat("0"); axis.getAxisY().setWindow(9.3, 10.8); axis.getAxisY().setAutoscaleInput(0); } public static void main(String argv[]) { new SampleEWMA().setVisible(true); } }