Dundas Chart for ASP.NET
Box Plot Chart
See Also Send comments on this topic.
Chart Types > Enterprise Edition Chart Types > Box Plot Chart



Glossary Item Box

Overview

Enterprise Edition Only Feature.

The Box Plot chart type consists of one or more box symbols that summarize the distribution of the data within one or more data sets. A Box Chart displays a rectangle with whisker lines extending from both ends. What makes a Box Plot unique, in comparison to standard chart types, is that the values for a box plot most often are calculated values from data that is present in another series. One box symbol, or data point, is associated with one data series. The data for a Box Plot series may still be populated using data binding, or by employing the Points Collection.

Box Plot Values

A Box Plot series uses at least 6 Y values. However, additional Y values may be added and plotted as markers (known as unusual points). The ordering of the points is important because each value represents a value on the chart.

 

Y Values Index

Y Value

0

Lower whisker

1

Upper whisker

2

Lower box

3

Upper box

4

Average / mean

5

Median

>=6

Other Unusual points shown as markers Average or Median Y values can be hidden if set to double.NaN

 

Figure 1: A Box Plot chart.

 

Median and Average box lines are drawn by default, but can be hidden using BoxPlotShowMedian, and BoxPlotShowAverage custom attributes. These values can be set to either true or false.

Example

This example demonstrates how to use the BoxPlotShowMedian and BoxPlotShowAverage custom attributes.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...

Chart1.Series["Series1"]["BoxPlotShowMedian"]="true"
Chart1.Series["Series1"]["BoxPlotShowAverage"]="true"
C# Copy Code
using Dundas.Charting.WebControl;
  ...

Chart1.Series["Series1"]["BoxPlotShowMedian"]="true";
Chart1.Series["Series1"]["BoxPlotShowAverage"]="true";

 

All standard markers styles can be used with the box chart by using the MarkerStyle property. When markers are not set, which is their default behavior, horizontal lines will be displayed similar to the stock chart. The Box Plot appearance can also be altered by use of the PointWidth custom attribute. This attribute will vary the width of the box portion of the Box Plot.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...

Chart1.Series("Series1")("PointWidth")="2"
C# Copy Code
using Dundas.Charting.WebControl;
  ...

Chart1.Series["Series1"]["PointWidth"]="2";

Calculated Box Plot Values

A custom attribute, BoxPlotSeries , is used to attach the box chart type to one or more existing series (by name) which to be used for calculations. This attribute can be set for the entire series or for each individual data points of the box chart. When set to the series, the BoxPlotSeries contains one or more semi-colon separated series names. As a result each Box Plot point values will be calculated and added for each series specified in the BoxPlotSeries attribute.

If BoxPlotSeries custom attribute is set in a data point object only, then only one series can be specified. The First Y value of the series will be used by default. Optionally, with the name of the series, the user can specify which value to use.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...

Chart1.Series("Series1")("BoxPlotSeries")="Price:Y2;Volume"
C# Copy Code
using Dundas.Charting.WebControl;
  ...
  
Chart1.Series["Series1"]["BoxPlotSeries"]="Price:Y2;Volume";

 

By default, the upper and lower box values are calculated using the 25th/75th percentile. The Whisker values are calculated using the 10th/90th percentile. This behavior can be changed using the BoxPlotPercentile and BoxPlotWhiskerPercentile attributes. The use of these values write the following code:

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...

Chart1.Series("Series1")("BoxPlotPercentile")="30"
Chart1.Series("Series1")("BoxPlotWhiskerPercentile")="5"
C# Copy Code
using Dundas.Charting.WebControl;
  ...
  
Chart1.Series["Series1"]["BoxPlotPercentile"]="30";
Chart1.Series["Series1"]["BoxPlotWhiskerPercentile"]="5";

 

Optionally, values from original data series that are outside of the whisker values can be added as individual values to the box plot. To enable this feature the BoxPlotShowUnusualValues attribute must be set to true in the manner shown below.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...

Chart1.Series("Series1")("BoxPlotShowUnusualValues")="true"
C# Copy Code
using Dundas.Charting.WebControl;
  ...
  
Chart1.Series["Series1"]["BoxPlotShowUnusualValues"]="true";

Example

This example demonstrates the steps required to make a 15th percentile Box Plot.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...
  
' Add data to Box Plot Source series.
Dim yValues As Double() = {55.62, 45.54, 73.45, 9.73, 88.42, 45.9, 63.6, 85.1,67.2, 23.6}
Chart1.Series("DataSeries").Points.DataBindY(yValues)

' Specify data series name for the Box Plot.
Chart1.Series("BoxPlotSeries")("BoxPlotSeries") = "DataSeries"

' Set whiskers 15th percentile.
Chart1.Series("BoxPlotSeries")("BoxPlotWhiskerPercentile") = "15"

' Show/Hide Average line.
Chart1.Series("BoxPlotSeries")("BoxPlotShowAverage") = "true"

' Show/Hide Median line.
Chart1.Series("BoxPlotSeries")("BoxPlotShowMedian") = "true"

' Show/Hide Unusual points.
Chart1.Series("BoxPlotSeries")("BoxPlotShowUnusualValues") = "true"
C# Copy Code
using Dundas.Charting.WebControl;
  ...
    
// Add data to Box Plot Source series.
yValues = {55.62, 45.54, 73.45, 9.73, 88.42, 45.9, 63.6, 85.1, 67.2, 23.6};
Chart1.Series["DataSeries"].Points.DataBindY(yValues);

// Specify data series name for the Box Plot.
Chart1.Series["BoxPlotSeries"]["BoxPlotSeries"] = "DataSeries";

// Set whiskers 15th percentile.
Chart1.Series["BoxPlotSeries"]["BoxPlotWhiskerPercentile"] = "15";

// Show/Hide Average line.
Chart1.Series["BoxPlotSeries"]["BoxPlotShowAverage"] = "true";

// Show/Hide Median line.
Chart1.Series["BoxPlotSeries"]["BoxPlotShowMedian"] = "true";

// Show/Hide Unusual points.
Chart1.Series["BoxPlotSeries"]["BoxPlotShowUnusualValues"] = "true";

 

Chart Details

Number of Y values per point:

6 or more

Number of series:

One

Support markers:

No

Cannot be combined with:

Doughnut, Pie, Bar

 

Custom Attributes

BoxPlotShowMedian, BoxPlotShowAverage, PointWidth, BoxPlotSeries, BoxPlotPercentile, BoxPlotWiskerPercentile, BoxPlotShowUnusualValues

 

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.