ChartDirector Ver 4.1 (ColdFusion Edition)

XYChart.addBoxWhiskerLayer


Usage

addBoxWhiskerLayer(boxTop, boxBottom [, maxData [, minData [, midData [, fillColor [, whiskerColor [, edgeColor ]]]]]])

Description

Adds a box-whisker layer to the XYChart, and specify the data sets to use for drawing the layer.

Traditionally, each box-whisker symbol represents 5 values, which are the as maximum, 3rd quartile, median, 1st quartile and minimum of some data samples.

A vertical box-whisker symbol (on a non-swapped XY chart) consists of a vertical line joining the maximum and minimum points, a box extending from the 1st quartile point to the 3rd quartile point, and 3 horizontal mark lines at the maximum, median and minimum points.

In practice, the box-whisker symbol is not limited to representing the maximum, 3rd quartile, median, 1st quartile and minimum values. It can be used to represent any ordered values.

The boxTop and boxBottom data sets specifies the top and bottom edges of the box. The maxData, minData and midData specifies the top, bottom and middle mark lines.

You can use empty arrays to disable showing some parts of the box-whisker symbol.

For example, if you just want to show a floating box, you can use only boxTop and boxBottom and set the maxData, minData and midData to empty arrays.

Similarly, if the boxTop, boxBottom and midData are set to empty arrays, only the top and bottom mark lines and the joining center line are visible. This style is most often used as "error bands" together with line charts.

In addition to maxData, minData and midData, you can add additional mark lines to the box-whisker element by adding more data sets using Layer.addDataSet.

By default, the box-whisker symbol will be drawn using the colors specified in the fillColor, whiskerColor and edgeColor argument. The fillColor and edgeColor are used as the fill and border colors of the box, while the whiskerColor is used as the color of the center line and the mark lines.

Internally, ChartDirector maps the colors of different parts of the box-whisker symbol to data set colors as shown in the following table. You may control the colors of the box-whisker symbol in more details by setting the data set colors directly. The data set objects can be obtained using Layer.getDataSet, and the colors can be changed using DataSet.setDataColor.

Box-Whisker Symbol ColorData Set Color
Fill color of the boxData Color for the first data set (index = 0)
Border color of the boxEdge Color for the first data set (index = 0)
Center line colorData Color for the second data set (index = 1)
Maximum value mark line colorData Color for the third data set (index = 2)
Minimum value mark line colorData Color for the fourth data set (index = 3)
Middle value mark line colorData Color for the fifth data set (index = 4)
Mark line color for additional mark linesData Color for the data set representing the additional mark line

Arguments

ArgumentDefaultDescription
boxTop(Mandatory)An array of numbers representing the top edge of the box.
boxBottom(Mandatory)An array of numbers representing the bottom edge of the box.
maxData[Empty_Array]An array of numbers representing the maximum value mark lines.
minData[Empty_Array]An array of numbers representing the minimum value mark lines.
midData[Empty_Array]An array of numbers representing the middle value mark lines.
fillColor-1The color used to fill the box. -1 means that the color is automatically selected from the palette.
whiskerColorLineColorThe color used to draw the central line and mark lines.
edgeColorLineColorThe color used to draw the border of the box.

Return Value

A BoxWhiskerLayer object representing the box-whisker layer created.