menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class FastLineSeries - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class FastLineSeries

    The FastLineSeries is a special kind of line series that can render a collection with a large number of data points.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    XYDataSeries
    FastLineSeries
    Inherited Members
    CartesianSeries.ActualXAxis
    CartesianSeries.ActualYAxis
    CartesianSeries.DataLabelSettings
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.EmptyPointMode
    CartesianSeries.EmptyPointModeProperty
    CartesianSeries.EmptyPointSettings
    CartesianSeries.EmptyPointSettingsProperty
    CartesianSeries.GetDataPoints(Double, Double, Double, Double)
    CartesianSeries.GetDataPoints(Rect)
    CartesianSeries.Label
    CartesianSeries.LabelProperty
    CartesianSeries.OnParentSet()
    CartesianSeries.ShowTrackballLabel
    CartesianSeries.ShowTrackballLabelProperty
    CartesianSeries.TrackballLabelTemplate
    CartesianSeries.TrackballLabelTemplateProperty
    CartesianSeries.XAxisName
    CartesianSeries.XAxisNameProperty
    CartesianSeries.YAxisName
    CartesianSeries.YAxisNameProperty
    ChartSeries.CreateAnimation(Action<Double>)
    ChartSeries.DrawDataLabel(ICanvas, Brush, String, PointF, Int32)
    ChartSeries.DrawSeries(ICanvas, ReadOnlyObservableCollection<ChartSegment>, RectF)
    ChartSeries.EnableAnimation
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltip
    ChartSeries.EnableTooltipProperty
    ChartSeries.Fill
    ChartSeries.FillProperty
    ChartSeries.IsVisible
    ChartSeries.IsVisibleOnLegend
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.IsVisibleProperty
    ChartSeries.ItemsSource
    ChartSeries.ItemsSourceProperty
    ChartSeries.LabelContext
    ChartSeries.LabelContextProperty
    ChartSeries.LabelTemplate
    ChartSeries.LabelTemplateProperty
    ChartSeries.LegendIcon
    ChartSeries.LegendIconProperty
    ChartSeries.ListenPropertyChange
    ChartSeries.ListenPropertyChangeProperty
    ChartSeries.Opacity
    ChartSeries.OpacityProperty
    ChartSeries.PaletteBrushes
    ChartSeries.PaletteBrushesProperty
    ChartSeries.SelectionBehavior
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.ShowDataLabels
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.TooltipTemplate
    ChartSeries.TooltipTemplateProperty
    ChartSeries.XBindingPath
    ChartSeries.XBindingPathProperty
    ChartSeries.XRange
    ChartSeries.YRange
    XYDataSeries.StrokeWidth
    XYDataSeries.StrokeWidthProperty
    XYDataSeries.YBindingPath
    XYDataSeries.YBindingPathProperty
    Namespace: Syncfusion.Maui.Toolkit.Charts
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class FastLineSeries : XYDataSeries, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon
    Remarks

    To render a series, create an instance of FastLineSeries 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 FastLineSeries 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 FastLineSeries 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.

    The FastLineSeries does not support empty points.

    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:FastLineSeries
                      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();
    
        FastLineSeries series = new FastLineSeries();
        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

    FastLineSeries()

    Initializes a new instance of the FastLineSeries class.

    Declaration
    public FastLineSeries()

    Fields

    EnableAntiAliasingProperty

    Identifies the EnableAntiAliasing bindable property.

    Declaration
    public static readonly BindableProperty EnableAntiAliasingProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The EnableAntiAliasing property indicates whether to enable smooth line drawing in the FastLineSeries.

    StrokeDashArrayProperty

    Identifies the StrokeDashArray bindable property.

    Declaration
    public static readonly BindableProperty StrokeDashArrayProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The StrokeDashArray property allows customization of the dash pattern used for the stroke in the FastLineSeries.

    Properties

    EnableAntiAliasing

    Gets or sets a value indicating whether to enable smooth line drawing for FastLineSeries.

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

    It accepts bool values and the default value is false.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:FastLineSeries ItemsSource="{Binding Data}"
                                   XBindingPath="XValue"
                                   YBindingPath="YValue"
                                   EnableAntiAliasing ="True" />
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        DoubleCollection doubleCollection = new DoubleCollection();
        doubleCollection.Add(5);
        doubleCollection.Add(3);
        FastLineSeries series = new FastLineSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              EnableAntiAliasing = true,
        };
    
        chart.Series.Add(series);

    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.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:FastLineSeries ItemsSource="{Binding Data}"
                                   XBindingPath="XValue"
                                   YBindingPath="YValue"
                                   StrokeDashArray="5,3"
                                   Stroke = "Red" />
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        DoubleCollection doubleCollection = new DoubleCollection();
        doubleCollection.Add(5);
        doubleCollection.Add(3);
        FastLineSeries series = new FastLineSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              StrokeDashArray = doubleCollection,
              Stroke = new SolidColorBrush(Colors.Red),
        };
    
        chart.Series.Add(series);

    Methods

    CreateSegment()

    Creates and initializes a new chart segment for the chart.

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

    GetDataPointIndex(Single, Single)

    Retrieves the index of a specific data point within a chart series, typically based on the interaction or coordinates on the chart.

    Declaration
    public override int GetDataPointIndex(float pointX, float pointY)
    Parameters
    Type Name Description
    System.Single pointX
    System.Single pointY
    Returns
    Type
    System.Int32
    Overrides
    ChartSeries.GetDataPointIndex(Single, Single)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved