Class BoxAndWhiskerSeries
The BoxAndWhiskerSeries class represents a series that plots box-and-whisker diagrams in a SfCartesianChart.
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.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.
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 |
Remarks
Defines the mode of the box plot (Exclusive or Inclusive).
OutlierShapeTypeProperty
Identifies the OutlierShapeType bindable property.
Declaration
public static readonly BindableProperty OutlierShapeTypeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Defines the shape used for outliers in the box plot.
ShowMedianProperty
Identifies the ShowMedian bindable property.
Declaration
public static readonly BindableProperty ShowMedianProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Determines whether to display the median line in the box plot.
ShowOutlierProperty
Identifies the ShowOutlier bindable property.
Declaration
public static readonly BindableProperty ShowOutlierProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Determines whether to display outliers in the box plot.
SpacingProperty
Identifies the Spacing bindable property.
Declaration
public static readonly BindableProperty SpacingProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Defines the spacing between box plots in the series.
StrokeProperty
Identifies the Stroke bindable property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Defines the stroke brush used for the box plot series.
WidthProperty
Identifies the Width bindable property.
Declaration
public static readonly BindableProperty WidthProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
Defines the width of the box plots in the series.
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 | Description |
---|---|
BoxPlotMode | It accepts the BoxPlotMode values and its default value is Exclusive. |
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 accepts the |
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 | Its accepts the |
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 |
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 | It accept the Microsoft.Maui.Controls.Brush values and 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 |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:BoxAndWhiskerSeries ItemsSource="{Binding BoxWhiskerData}"
XBindingPath="Department"
YBindingPath="Age"
Width="0.7"/>
</chart:SfCartesianChart>
Methods
CreateSegment()
Creates and initializes a new chart segment for the chart.
Declaration
protected override ChartSegment CreateSegment()
Returns
Type |
---|
ChartSegment |