ShewhartControlChart and ControlLimit

The ShewhartControlChart class is primarily used as the base class of other control chart classes. It provides the common functionality for the control charts.

For example, the default IMSL.NET control charts include a center line and an upper and lower control limit at plus or minus three standard deviations from the center line. The Western Electric Company Rules (or WECO) are control limits at plus or minus one, two, and three standard deviations from the mean. They can be added using the method AddWecoLimits in the ShewhartControlChart class.

The ShewhartControlChart uses the ControlLimit class for the upper and lower control limits and for the center line. Additional control limits, such as the WECO limits, can be added to a ShewhartControlChart. The line attributes can be used with ControlLimit to modify the drawing of each con­trol limit.

The ShewhartControlChart class can be used directly when the statistics are computed by the user. In this example, data from Montgomery, Douglas C., Introduction to Statistical Quality Control, 4th Ed,., 2001, New York: John Wiley and Sons, p. 406 is plotted. The code explicitly sets the lower control limit to 7 and the upper control limit to 13.

Further citations throughout this chapter for data plotted from Montgomery appear as parenthetical citations, e.g. (Montgomery 406).

Control Limit Customization

Control Limits and center lines can be added using the ControlLimit.SetValue methods; AddCenterLine().SetValue(int) (see AddCenterLine()), AddUpperControlLimit().SetValue(int) (see AddUpperControlLimit()) and AddLowerControlLimit().SetValue(int) (see AddLowerControlLimit()). It is foreseeable that the default appearance might not be optimal for every application. In particular moving components or removing the ControlLimit objects can accomplished.

Before modifying a ControlLimit title it is important to realize the ControlLimit title text is justified in the lower right corner of a Text object (TEXT_X_RIGHT | TEXT_Y_BOTTOM). With this in mind, formatted strings may be used to alter their appearance. For example, to retain the ControlLimit line but eliminate the title, get the ControlLimit and set the title to an empty string (i.e. UpperControlLimit.SetTitle("");). In addition, the following can be used to move the title closer to the y-axis (note that repeated, leading, and trailing new lines "\n" and spaces are ignored):

xbars.UpperControlLimit.SetTitle("ucl=15\t\t\t");

After being added, it may be the case that a ControlLimit should be removed.  This is accomplished with the objectís inherited Remove() method.

(Download Code)

 

using Imsl.Chart2D;

using Imsl.Chart2D.QC;

 

public class SampleShewhart : FrameChart {

    static 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 SampleShewhart() {

        Chart chart = this.Chart;

        AxisXY axis = new AxisXY(chart);

        ShewhartControlChart xbars = new ShewhartControlChart(axis);

        xbars.SetData(data);

        xbars.AddLowerControlLimit().SetValue(7);

        xbars.AddCenterLine().SetValue(10);

        xbars.AddUpperControlLimit().SetValue(13);

    }

 

 

    public static void Main(string[] argv) {

        System.Windows.Forms.Application.Run(new SampleShewhart());

    }

}



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