MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SplineSeries

    Show / Hide Table of Contents

    Class SplineSeries

    The SplineSeries is a set of data points linked together by smooth beizer curves.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    XYDataSeries
    SplineSeries
    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 SplineSeries : XYDataSeries, IDatapointSelectionDependent, ITooltipDependent, IMarkerDependent
    Remarks

    To render a series, create an instance of SplineSeries class, and add it to the Series collection.

    It provides options for Fill, PaletteBrushes, StrokeWidth, StrokeDashArray, 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 SplineSeries 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 SplineSeries 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:SplineSeries
                      ItemsSource="{Binding Data}"
                      XBindingPath="XValue"
                      YBindingPath="YValue"/>
              </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();
    
        SplineSeries series = new SplineSeries();
        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

    SplineSeries()

    Declaration
    public SplineSeries()

    Fields

    MarkerSettingsProperty

    Identifies the MarkerSettings bindable property.

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

    ShowMarkersProperty

    Identifies the ShowMarkers bindable property.

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

    StrokeDashArrayProperty

    Identifies the StrokeDashArray bindable property.

    Declaration
    public static readonly BindableProperty StrokeDashArrayProperty
    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

    MarkerSettings

    Gets or sets the option for customize the series markers.

    Declaration
    public ChartMarkerSettings MarkerSettings { get; set; }
    Property Value
    Type Description
    ChartMarkerSettings

    ShowMarkers

    Gets or sets the value indicating whether to show markers for the series data point.

    Declaration
    public bool ShowMarkers { get; set; }
    Property Value
    Type Description
    System.Boolean

    StrokeDashArray

    Gets or sets the stroke dash array to customize the appearance of stroke.

    Declaration
    public DoubleCollection StrokeDashArray { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.DoubleCollection

    It accepts the Microsoft.Maui.Controls.DoubleCollection value and the default value is null.

    Type

    Gets or sets a value that indicates the shape of the spline series.

    Declaration
    public SplineType Type { get; set; }
    Property Value
    Type Description
    SplineType

    It accepts SplineType values and its default value is Natural.

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

    Methods

    CreateSegment()

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

    DrawMarker(ICanvas, Int32, ShapeType, Rect)

    Declaration
    protected virtual void DrawMarker(ICanvas canvas, int index, ShapeType type, Rect rect)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.ICanvas canvas
    System.Int32 index
    ShapeType type
    Microsoft.Maui.Graphics.Rect rect

    See Also

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