menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ScatterSeries - API Reference

    Show / Hide Table of Contents

    Class ScatterSeries

    The ScatterSeries displays a collection of data points represented by a circle of equal size.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    XYDataSeries
    ScatterSeries
    Inherited Members
    XYDataSeries.YBindingPathProperty
    XYDataSeries.StrokeWidthProperty
    XYDataSeries.YBindingPath
    XYDataSeries.StrokeWidth
    CartesianSeries.XAxisNameProperty
    CartesianSeries.YAxisNameProperty
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.LabelProperty
    CartesianSeries.ShowTrackballLabelProperty
    CartesianSeries.OnBindingContextChanged()
    CartesianSeries.XAxisName
    CartesianSeries.YAxisName
    CartesianSeries.DataLabelSettings
    CartesianSeries.Label
    CartesianSeries.ActualXAxis
    CartesianSeries.ActualYAxis
    CartesianSeries.ShowTrackballLabel
    ChartSeries.ItemsSourceProperty
    ChartSeries.XBindingPathProperty
    ChartSeries.FillProperty
    ChartSeries.PaletteBrushesProperty
    ChartSeries.IsVisibleProperty
    ChartSeries.OpacityProperty
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltipProperty
    ChartSeries.TooltipTemplateProperty
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.LegendIconProperty
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.GetDataPointIndex(Single, Single)
    ChartSeries.CreateAnimation(Action<Double>)
    ChartSeries.DrawDataLabel(ICanvas, Brush, String, PointF, Int32)
    ChartSeries.DrawSeries(ICanvas, ReadOnlyObservableCollection<ChartSegment>, RectF)
    ChartSeries.ItemsSource
    ChartSeries.XBindingPath
    ChartSeries.Fill
    ChartSeries.PaletteBrushes
    ChartSeries.IsVisible
    ChartSeries.Opacity
    ChartSeries.EnableAnimation
    ChartSeries.EnableTooltip
    ChartSeries.TooltipTemplate
    ChartSeries.ShowDataLabels
    ChartSeries.LegendIcon
    ChartSeries.IsVisibleOnLegend
    ChartSeries.SelectionBehavior
    ChartSeries.XRange
    ChartSeries.YRange
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class ScatterSeries : XYDataSeries, IDatapointSelectionDependent, ITooltipDependent, 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
    • Xaml
    • C#
    • ViewModel
        <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>
        SfCartesianChart chart = new SfCartesianChart();
    
        NumericalAxis xAxis = new NumericalAxis();
        NumericalAxis yAxis = new NumericalAxis();
    
        chart.XAxes.Add(xAxis);
        chart.YAxes.Add(yAxis);
    
        ViewModel viewModel = new ViewModel();
    
        ScatterSeries series = new ScatterSeries();
        series.PointHeight = 10;
        series.PointWidth = 10;
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        chart.Series.Add(series);
        public ObservableCollection<Model> Data { get; set; }
    
        public ViewModel()
        {
           Data = new ObservableCollection<Model>();
           Data.Add(new Model() { XValue = 10, YValue = 100 });
           Data.Add(new Model() { XValue = 20, YValue = 150 });
           Data.Add(new Model() { XValue = 30, YValue = 110 });
           Data.Add(new Model() { XValue = 40, YValue = 230 });
        }

    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 Description
    Microsoft.Maui.Controls.BindableProperty

    PointWidthProperty

    Identifies the PointWidth bindable property.

    Declaration
    public static readonly BindableProperty PointWidthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    StrokeProperty

    Identifies the Stroke bindable property.

    Declaration
    public static readonly BindableProperty StrokeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    TypeProperty

    Identifies the Type bindable property.

    Declaration
    public static readonly BindableProperty TypeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    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 double values and its default value is 5.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:ScatterSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               PointHeight = "20"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        ScatterSeries series = new ScatterSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              PointHeight = 20,
        };
    
        chart.Series.Add(series);

    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 double values and its default value is 5.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:ScatterSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               PointWidth = "20"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        ScatterSeries series = new ScatterSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              PointWidth = 20,
        };
    
        chart.Series.Add(series);

    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
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:ScatterSeries ItemsSource="{Binding Data}"
                                  XBindingPath="XValue"
                                  YBindingPath="YValue"
                                  Stroke = "Red" />
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        ScatterSeries series = new ScatterSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              Stroke = new SolidColorBrush(Colors.Red),
        };
    
        chart.Series.Add(series);

    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
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:ScatterSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               ShapeType = "Diamond"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        ScatterSeries series = new ScatterSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              Type = ShapeType.Diamond,
        };
    
        chart.Series.Add(series);

    Methods

    CreateSegment()

    Declaration
    protected override ChartSegment CreateSegment()
    Returns
    Type Description
    ChartSegment
    Overrides
    ChartSeries.CreateSegment()

    See Also

    ScatterSegment
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved