Class BoxAndWhiskerSeries
The BoxAndWhiskerSeries class represents a series that plots box-and-whisker diagrams in a SfCartesianChart.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class BoxAndWhiskerSeries : XYDataSeries, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon
Remarks
A box-and-whisker plot is a chart that shows the distribution of a dataset, indicating the median, quartiles, and outliers.
To render a series, create an instance of BoxAndWhiskerSeries class, and add it to the Series collection.
It provides options for Fill,StrokeWidth, Stroke, and Opacity to customize the appearance.
EnableTooltip - A tooltip displays information while tapping or mouse hovering above a segment. To display the tooltip on a chart, you need to set the EnableTooltip property as true in BoxAndWhiskerSeries class, and also refer TooltipBehavior property.
Animation - To animate the series, set True to the EnableAnimation property.
LegendIcon - Customize the legend icon using the LegendIcon property.
Spacing - To specify the spacing between segments using the Spacing property.
Width - To specify the width of the box using the Width property.
This series does not yet support trackball behaviour.
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.YAxes>
<chart:SfCartesianChart.Series>
<chart:BoxAndWhiskerSeries
ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"/>
</chart:SfCartesianChart.Series>
</chart:SfCartesianChart>
Constructors
BoxAndWhiskerSeries()
Declaration
public BoxAndWhiskerSeries()
Fields
BoxPlotModeProperty
Identifies the BoxPlotMode bindable property.
Declaration
public static readonly BindableProperty BoxPlotModeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
OutlierShapeTypeProperty
Identifies the OutlierShapeType bindable property.
Declaration
public static readonly BindableProperty OutlierShapeTypeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ShowMedianProperty
Identifies the ShowMedian bindable property.
Declaration
public static readonly BindableProperty ShowMedianProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ShowOutlierProperty
Identifies the ShowOutlier bindable property.
Declaration
public static readonly BindableProperty ShowOutlierProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SpacingProperty
Identifies the Spacing bindable property.
Declaration
public static readonly BindableProperty SpacingProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
StrokeProperty
Identifies the Stroke bindable property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
WidthProperty
Identifies the Width bindable property.
Declaration
public static readonly BindableProperty WidthProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
BoxPlotMode
Gets or sets the plot mode, which defines how the box plot series should be rendered.
Declaration
public BoxPlotMode BoxPlotMode { get; set; }
Property Value
Type |
---|
BoxPlotMode |
Remarks
Normal - This is the default value, which plots the minimum, maximum, median, and quartiles of the data.
Inclusive - This plots all the data values within the interquartile range (IQR), in addition to the minimum, maximum, median, and quartiles.
Exclusive - This plots all the data values outside the interquartile range (IQR), in addition to the minimum, maximum, median, and quartiles.
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
BoxPlotMode = "Inclusive" />
</chart:SfCartesianChart>
OutlierShapeType
Gets or sets the shape type for the outlier.
Declaration
public ShapeType OutlierShapeType { get; set; }
Property Value
Type | Description |
---|---|
ShapeType | It accepts ShapeType values and its default value is Circle. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
OutlierShapeType="Plus" />
</chart:SfCartesianChart>
ShowMedian
Gets or sets a value indicating whether to show the median in the box plot or not.
Declaration
public bool ShowMedian { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Its default is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
ShowMedian="True"/>
</chart:SfCartesianChart>
ShowOutlier
Gets or sets the value that indicates whether to show or hide the outlier of the box plot.
Declaration
public bool ShowOutlier { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
ShowOutlier="False" />
</chart:SfCartesianChart>
Spacing
Gets or sets a value to indicate gap between the segments across the series.
Declaration
public double Spacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts values between 0 and 1, and its default is 0. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
Spacing="0.5" />
</chart:SfCartesianChart>
Stroke
Gets or sets a value to customize the border's appearance of the BoxAndWhisker series.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | Its default is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
Stroke="Red" />
</chart:SfCartesianChart>
Width
Gets or sets a value to indicate the width of the box plot.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts values between 0 and 1, and default is 0.8. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
Width="0.7"/>
</chart:SfCartesianChart>
Methods
CreateSegment()
Declaration
protected override ChartSegment CreateSegment()
Returns
Type |
---|
ChartSegment |