Back to Devexpress

SeriesLayoutOptions.BoxAndWhisker Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-serieslayoutoptions.md

latest4.9 KB
Original Source

SeriesLayoutOptions.BoxAndWhisker Property

Returns options for a box and whisker data series.

Namespace : DevExpress.Spreadsheet.Charts

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
BoxAndWhiskerSeriesOptions BoxAndWhisker { get; }
vb
ReadOnly Property BoxAndWhisker As BoxAndWhiskerSeriesOptions

Property Value

TypeDescription
BoxAndWhiskerSeriesOptions

An object that stores series options for box and whisker charts.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to BoxAndWhisker
Series

.LayoutOptions .BoxAndWhisker

|

Remarks

Use the BoxAndWhiskerSeriesOptions object’s properties to specify series options for a box and whisker chart.

PropertyDescription
BoxAndWhiskerSeriesOptions.ShowInnerPointsSpecifies whether to show inner data points that lie between the lower and upper whisker lines.
BoxAndWhiskerSeriesOptions.ShowOutlierPointsSpecifies whether to show outlier data points that lie either below the lower whisker line or above the upper whisker line.
BoxAndWhiskerSeriesOptions.ShowMeanLineSpecifies whether to display a line that connects the means of boxes in the series.
BoxAndWhiskerSeriesOptions.ShowMeanMarkersSpecifies whether to show the mean markers.
BoxAndWhiskerSeriesOptions.QuartileCalculationMethodDefines the quartile calculation method.

Example

The example below demonstrates how to create a box and whisker chart and specify its options.

csharp
// Create a box and whisker chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.BoxAndWhisker, worksheet["B2:E17"]);
chart.TopLeftCell = worksheet.Cells["G2"];
chart.BottomRightCell = worksheet.Cells["N17"];

// Set the minimum and maximum values for the value axis.
Axis axis = chart.PrimaryAxes[1];
axis.Scaling.AutoMax = false;
axis.Scaling.Max = 70;
axis.Scaling.AutoMin = false;
axis.Scaling.Min = 40;

// Specify series options.
foreach (Series series in chart.Series)
{
    var options = series.LayoutOptions.BoxAndWhisker;
    options.ShowInnerPoints = true;
    options.ShowMeanLine = false;
    options.ShowOutlierPoints = true;
    options.ShowMeanMarkers = true;
    options.QuartileCalculationMethod = QuartileCalculationMethod.ExclusiveMedian;
}

// Add the chart title.
chart.Title.Visible = true;
chart.Title.SetValue("Academic Performance Distribution");
vb
' Create a box and whisker chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.BoxAndWhisker, worksheet("B2:E17"))
chart.TopLeftCell = worksheet.Cells("G2")
chart.BottomRightCell = worksheet.Cells("N17")

' Set the minimum and maximum values for the value axis.
Dim axis As Axis = chart.PrimaryAxes(1)
axis.Scaling.AutoMax = False
axis.Scaling.Max = 70
axis.Scaling.AutoMin = False
axis.Scaling.Min = 40

' Specify series options.
For Each series As Series In chart.Series
    Dim options As BoxAndWhiskerSeriesOptions = series.LayoutOptions.BoxAndWhisker
    options.ShowInnerPoints = True
    options.ShowMeanLine = False
    options.ShowOutlierPoints = True
    options.ShowMeanMarkers = True
    options.QuartileCalculationMethod = QuartileCalculationMethod.ExclusiveMedian
Next series

' Add the chart title.
chart.Title.Visible = True
chart.Title.SetValue("Academic Performance Distribution")

See Also

SeriesLayoutOptions Interface

SeriesLayoutOptions Members

DevExpress.Spreadsheet.Charts Namespace