addBoxWhiskerLayer(boxTop, boxBottom [, maxData [, minData [, midData [, fillColor [, whiskerColor [, edgeColor ]]]]]])
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 Color | Data Set Color |
---|
Fill color of the box | Data Color for the first data set (index = 0) |
Border color of the box | Edge Color for the first data set (index = 0) |
Center line color | Data Color for the second data set (index = 1) |
Maximum value mark line color | Data Color for the third data set (index = 2) |
Minimum value mark line color | Data Color for the fourth data set (index = 3) |
Middle value mark line color | Data Color for the fifth data set (index = 4) |
Mark line color for additional mark lines | Data Color for the data set representing the additional mark line |
A
BoxWhiskerLayer object representing the box-whisker layer created.
© 2006 Advanced Software Engineering Limited. All rights reserved.