Chart / Charts / Chart Types / Cartesian / Series / Box And Whiskers Series
In This Topic
    Box And Whiskers Series
    In This Topic

    Box and Whiskers plots are used to interpret the distribution of data. Each box and whiskers item represents a set of values and displays statistical information like minimum, maximum, and median values, upper and lower quartiles, outliers, and optionally a mean value. The following image shows a typical box and whiskers chart:

     Creating a Box And Whiskers Series

    Box and Whiskers series are represented by the NBoxAndWhiskersSeries type. An instance of this type must be added to the series collection of a Cartesian chart:

    C#
    Copy Code
    NBoxAndWhiskerSeries boxAndWhiskers = new NBoxAndWhiskerSeries();
    chart.Series.Add(boxAndWhiskers);
    
     Passing Data

    Box and Whiskers series accept data points of type NBoxAndWhiskerDataPoint. The following code snippet shows how to add data to a box and whiskers series:

    C#
    Copy Code
    NBoxAndWhiskerSeries boxAndWhiskers = new NBoxAndWhiskerSeries();
    chart.Series.Add(boxAndWhiskers);
    NBoxAndWhiskerDataPoint boxAndWhiskersDataPoint = new NBoxAndWhiskerDataPoint();
    boxAndWhiskersDataPoint.LowerBoxValue = 10;
    boxAndWhiskersDataPoint.UpperBoxValue = 20;
    boxAndWhiskersDataPoint.MedianValue = 12;
    boxAndWhiskersDataPoint.AverageValue = 15;
    boxAndWhiskersDataPoint.UpperWhiskerValue = 24;
    boxAndWhiskersDataPoint.LowerWhiskerValue = 7;
    boxAndWhiskersDataPoint.Outliers = new NDomArray<double>(new double[] { 5, 25 });
    boxAndWhiskers.DataPoints.Add(boxAndWhiskersDataPoint);
    
     Controlling the box width
    The box width is controlled in the same way as you control the width of bars in a bar series. For more information check out the Bar Series topic.
     Controlling the whisker's width

    The width of the whiskers is controlled by the WhiskerWidthPercent property, which specifies the whisker's width as a percentage of the computed box width. The following example shows how to make the whisker's width equal to the box width:

    C#
    Copy Code
    boxAndWhiskers.WhiskerWidthPercent = 100;
    
     Formatting Commands

    The box and whiskers series supports the following formatting commands in addition to the standard (per data point) formatting commands:

    <upperboxvalue> - displays the upper box value using the series value formatter.
    <lowerboxvalue> - displays the lower box value using the series value formatter.
    <medianvalue> - displays the median box value using the series value formatter.
    <averagevalue> - displays the average box value using the series value formatter.
    <upperwhiskervalue> - displays the upper box value using the series value formatter.
    <lowerwhiskervalue> - displays the lower box value using the series value formatter.

    See Also