Back to Devexpress

Box Plot Series

wpf-401372-controls-and-libraries-charts-suite-chart-control-series-2d-series-types-box-plot-series.md

latest5.0 KB
Original Source

Box Plot Series

  • May 28, 2021
  • 5 minutes to read

The Box Plot (also called Box-and-Whisker Plot) chart is used to analyze statistic-driven data points. To draw a Box Plot point, pass the Min, Quartile1, Median, Quartile3, and Max parameters. You can also display a set of Outliers and a Mean value (optional).

Run Demo: Box Plot

Chart Type Characteristics

The table below lists the main box plot chart characteristics:

FeatureValue
Series view typeBoxPlotSeries2D
Diagram typeXYDiagram2D
Number of arguments per series point1
Number of values per series point6 values and an array of outliers

The following image shows the Box Plot chart elements:

You can also display the series Mean line. Set the BoxPlotSeries2D.MeanLineVisible property to true for this:

Limitations

Create a Box Plot Chart

The following example creates a Box Plot chart with three points:

Format the Crosshair Label

Use the XYSeries2D.CrosshairLabelPattern property to format the crosshair label text.

The Chart Control provides the following placeholders that you can use in patterns:

PlaceholderDescription
{BP_MIN}Displays the Box Plot point’s Minimum value.
{BP_Q1}Displays the Box Plot point’s First Quartile value.
{BP_MDN}Displays the Box Plot point’s Median value.
{BP_AVG}Displays the Box Plot point’s Mean value.
{BP_Q3}Displays the Box Plot point’s Third Quartile value.
{BP_MAX}Displays the Box Plot point’s Maximum value.
xaml
<dxc:BoxPlotSeries2D CrosshairLabelPattern="{}{A}&#x0a;Min: {BP_MIN}&#x0a;Q1: {BP_Q1}&#x0a;Q3: {BP_Q3}&#x0a;Max: {BP_MAX}"/>

You can use format specifiers to format the placeholders’ values. For example, the “{BP_Q1:f1}” pattern displays the First Quartile value with one digit after the comma.

Change Chart Appearance

This section explains how to modify the Box Plot chart’s appearance.

The BoxPlotSeries2D class exposes the following appearance settings for the Box Plot chart:

xaml
<dxc:BoxPlotSeries2D MeanLineVisible="True"
                     CapWidthPercentage="50" 
                     BoxWidth="0.5"
                     Brush="MediumSeaGreen">
    <dxc:BoxPlotSeries2D.MeanLineStyle>
        <dxc:LineStyle Thickness="2" DashCap="Flat">
            <dxc:LineStyle.DashStyle>
                <DashStyle Dashes="2 1 5 1"/>
            </dxc:LineStyle.DashStyle>
        </dxc:LineStyle>
    </dxc:BoxPlotSeries2D.MeanLineStyle>
</dxc:BoxPlotSeries2D>

See Also

Series