Class ScatterSeries
The ScatterSeries displays a collection of data points represented by a circle of equal size.
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class ScatterSeries : XYDataSeries, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon
Remarks
To render a series, create an instance of ScatterSeries class, and add it to the Series collection.
It provides options for Fill, PaletteBrushes, StrokeWidth, Stroke, and Opacity to customize the appearance.
Size - Specify the circle size using the PointHeight, and PointWidth properties.
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 ScatterSeries class, and also refer TooltipBehavior property.
Data Label - Data labels are used to display values related to a chart segment. To render the data labels, you need to set the ShowDataLabels property as true in ScatterSeries class. To customize the chart data labels alignment, placement, and label styles, you need to create an instance of CartesianDataLabelSettings and set to the DataLabelSettings property.
Animation - To animate the series, set True to the EnableAnimation property.
LegendIcon - To customize the legend icon using the LegendIcon property.
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.YAxes>
<chart:SfCartesianChart.Series>
<chart:ScatterSeries
ItemsSource = "{Binding Data}"
XBindingPath = "XValue"
YBindingPath = "YValue"
PointHeight = "10"
PointWidth = "10"/>
</chart:SfCartesianChart.Series>
</chart:SfCartesianChart>
Constructors
ScatterSeries()
Initializes a new instance of the ScatterSeries class.
Declaration
public ScatterSeries()
Fields
PointHeightProperty
Identifies the PointHeight bindable property.
Declaration
public static readonly BindableProperty PointHeightProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The PointHeight property defines the height of the scatter segment size.
PointWidthProperty
Identifies the PointWidth bindable property.
Declaration
public static readonly BindableProperty PointWidthProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The PointWidth property defines the width of the scatter segment size.
StrokeProperty
Identifies the Stroke bindable property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The Stroke property helps to customize the stroke appearance of the scatter series.
TypeProperty
Identifies the Type bindable property.
Declaration
public static readonly BindableProperty TypeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The Type property indicates the shape of the scatter series.
Properties
PointHeight
Gets or sets a value that defines the height of the scatter segment size.
Declaration
public double PointHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ScatterSeries ItemsSource = "{Binding Data}"
XBindingPath = "XValue"
YBindingPath = "YValue"
PointHeight = "20"/>
</chart:SfCartesianChart>
PointWidth
Gets or sets a value that defines the width of the scatter segment size.
Declaration
public double PointWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ScatterSeries ItemsSource = "{Binding Data}"
XBindingPath = "XValue"
YBindingPath = "YValue"
PointWidth = "20"/>
</chart:SfCartesianChart>
Stroke
Gets or sets a value to customize the stroke appearance of the scatter series.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts Microsoft.Maui.Controls.Brush values and its default value is null. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ScatterSeries ItemsSource = "{Binding Data}"
XBindingPath = "XValue"
YBindingPath = "YValue"
StrokeWidth = "2"
Stroke = "Red" />
</chart:SfCartesianChart>
Type
Gets or sets a value that indicates the shape of the scatter series.
Declaration
public ShapeType Type { get; set; }
Property Value
Type | Description |
---|---|
ShapeType | It accepts ShapeType values and its default value is Circle. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ScatterSeries ItemsSource = "{Binding Data}"
XBindingPath = "XValue"
YBindingPath = "YValue"
ShapeType = "Diamond"/>
</chart:SfCartesianChart>
Methods
CreateSegment()
Creates and initializes a new chart segment for the chart.
Declaration
protected override ChartSegment CreateSegment()
Returns
Type |
---|
ChartSegment |