Example: Pareto Chart
The number of defects caused by four different factors were measured and plotted as a Pareto chart. The class ParetoChart
sorts the factors in order of number of defects.
using Imsl.Chart2D;
using Imsl.Chart2D.QC;
using System;
public class ParetoEx1 : FrameChart
{
public ParetoEx1()
{
AxisXY axisBar = new AxisXY(this.Chart);
int[] numberDefects = new int[]{71, 23, 128, 37};
System.String[] labels = new System.String[]{"Gear", "Diode", "Relay", "Spindle"};
ParetoChart pareto = new ParetoChart(axisBar, labels, numberDefects);
pareto.FillColor = System.Drawing.Color.Red;
pareto.AddCumulativeLine();
Data cumulativeLine = pareto.CumulativeLine;
cumulativeLine.MarkerType = Data.MARKER_TYPE_FILLED_CIRCLE;
cumulativeLine.LineColor = System.Drawing.Color.Blue;
cumulativeLine.MarkerColor = System.Drawing.Color.Blue;
this.Chart.ChartTitle.SetTitle("Manufacturing Defects");
axisBar.AxisY.AxisTitle.SetTitle("Defects");
pareto.CumulativeAxis.AxisY.AxisTitle.SetTitle("Cumulative Defect Percentage");
}
public static void Main(string[] argv)
{
System.Windows.Forms.Application.Run(new ParetoEx1());
}
}
Output
Link to C# source.