StatBean Name: ParetoChart

Purpose: Constructs a Pareto chart to display the most common causes of problems or defects.

DataSource: any (automatic data transfer if Tabulation).


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
barColorColor arrayThe colors to be used for the bars.Any valid Color.Various.
barLabelColorColorThe color of the bar labels.Any valid Color.Color.black
barLabelFontFontThe font to be used for the bar labels.Any Font."Serif",0,12
barLabelsStringLabels to add at end of bars."None","Class","Frequency","Percentage"."None"
barWidthintPercentage of available space used by bars (affects bar gap).1-10090
classNameStringName for classes to be used in title.Any string.""
cumulativeBarsbooleanWhether to locate the bars at cumulative positions.true,falsefalse
cumulativeLinebooleanWhether to plot a cumulative line across the top of the bars.true,falsetrue
decimalPlacesintNumber of decimal places for displaying frequencies.0+, or -1 for default.-1
drawVerticalbooleanWhether to make the bars vertical.true,falsetrue
frequencyVariableNameStringThe name of the column containing class frequencies.Any string."Frequency"
highlightBarintNumber of the highlighted bar, if any.0 if none, else 1+.0
highlightColorColorThe color of the highlighted bar.Any valid Color.Color.red
labelVariableNameStringThe name of the column containing class labels.Any string."Label"
rotateClassLabelsbooleanWhether to rotate the class labels on the x-axis.true,falsetrue
scaleByPercentagebooleanWhether to show percentages on the Y axis.true,falsetrue
useOneColorbooleanWhether to draw all bars (except the highlighted one) in a single color.true,falsetrue
weightVariableNameStringThe name of the column containing optional class weights.Any string.""

Code Sample

//create a datasource bean
FileDataSource fileDataSource1 = new STATBEANS.FileDataSource();

//set the file name to be read
fileDataSource1.setFileName("c:\\statbeans\\samples\\pareto.txt");

//create a chart bean
ParetoChart paretoChart1 = new STATBEANS.ParetoChart();

//set the data column names
paretoChart1.setFrequencyVariableName("Count");
paretoChart1.setLabelVariableName("Problem");

//set the display name
paretoChart1.setClassName("Defects");

//rotate the class labels
paretoChart1.setUseDefaultFonts(false);
paretoChart1.setRotateClassLabels(true);

//set new margtins
paretoChart1.setTopMargin(10);
paretoChart1.setBottomMargin(35);

//make the plot bean a listener for changes in the FileDataSource bean
paretoChart1.addDataChangeListener(fileDataSource1.listenerForDataChange);

//instruct the fileDataSource bean to read the file
fileDataSource1.readData();