menu

MAUI Toolkit

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

    Show / Hide Table of Contents

    Class StackingAreaSeries

    The StackingAreaSeries is a collection of data points, where the areas are stacked on top of each other.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    XYDataSeries
    StackingSeriesBase
    StackingAreaSeries
    StackingArea100Series
    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
    StackingSeriesBase.GroupingLabel
    StackingSeriesBase.GroupingLabelProperty
    StackingSeriesBase.Stroke
    StackingSeriesBase.StrokeDashArray
    StackingSeriesBase.StrokeDashArrayProperty
    StackingSeriesBase.StrokeProperty
    XYDataSeries.StrokeWidth
    XYDataSeries.StrokeWidthProperty
    XYDataSeries.YBindingPath
    XYDataSeries.YBindingPathProperty
    Namespace: Syncfusion.Maui.Toolkit.Charts
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class StackingAreaSeries : StackingSeriesBase, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon, IMarkerDependent
    Remarks

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

    It provides options for Fill, PaletteBrushes, StrokeWidth, Stroke, 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 StackingAreaSeries 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 StackingAreaSeries class. To customize the chart data labels 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:CategoryAxis/>
        </chart:SfCartesianChart.XAxes>
    
        <chart:SfCartesianChart.YAxes>
            <chart:NumericalAxis/>
        </chart:SfCartesianChart.YAxes>
    
        <chart:StackingAreaSeries
            ItemsSource = "{Binding MedalDetails}"
            XBindingPath = "CountryName"
            YBindingPath = "GoldMedals"/>
    
        <chart:StackingAreaSeries
            ItemsSource = "{Binding MedalDetails}"
            XBindingPath = "CountryName"
            YBindingPath = "SilverMedals"/>
    
        <chart:StackingAreaSeries
            ItemsSource = "{Binding MedalDetails}"
            XBindingPath = "CountryName"
            YBindingPath = "BronzeMedals"/>
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    CategoryAxis xAxis = new CategoryAxis();
    NumericalAxis yAxis = new NumericalAxis();
    
    chart.XAxes.Add(xAxis);
    chart.YAxes.Add(yAxis);
    
    ViewModel viewModel = new ViewModel();
    
    StackingAreaSeries goldSeries = new StackingAreaSeries();
    goldSeries.ItemsSource = viewModel.MedalDetails;
    goldSeries.XBindingPath = "CountryName";
    goldSeries.YBindingPath = "GoldMedals";
    
    StackingAreaSeries silverSeries = new StackingAreaSeries();
    silverSeries.ItemsSource = viewModel.MedalDetails;
    silverSeries.XBindingPath = "CountryName";
    silverSeries.YBindingPath = "SilverMedals";
    
    StackingAreaSeries bronzeSeries = new StackingAreaSeries();
    bronzeSeries.ItemsSource = viewModel.MedalDetails;
    bronzeSeries.XBindingPath = "CountryName";
    bronzeSeries.YBindingPath = "BronzeMedals";
    
    chart.Series.Add(goldSeries);
    chart.Series.Add(silverSeries);
    chart.Series.Add(bronzeSeries);
    
    this.Content = chart;
        public ObservableCollection<MedalData> MedalDetails { get; set; }
    
        public ViewModel()
        {
            MedalDetails = new ObservableCollection<MedalData>
            {
                new MedalData() { CountryName = "USA", GoldMedals = 10, SilverMedals = 5, BronzeMedals = 7 },
                new MedalData() { CountryName = "China", GoldMedals = 8, SilverMedals = 10, BronzeMedals = 6 },
                new MedalData() { CountryName = "Russia", GoldMedals = 6, SilverMedals = 4, BronzeMedals = 8 },
                new MedalData() { CountryName = "UK", GoldMedals = 4, SilverMedals = 7, BronzeMedals = 3 }
            };
        }

    Constructors

    StackingAreaSeries()

    Initializes a new instance of the StackingAreaSeries.

    Declaration
    public StackingAreaSeries()

    Fields

    MarkerSettingsProperty

    Identifies the MarkerSettings bindable property.

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

    The MarkerSettings property allows customize the series markers.

    ShowMarkersProperty

    Identifies the ShowMarkers bindable property.

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

    The ShowMarkers property determines whether the chart markers are visible on the series.

    Properties

    MarkerSettings

    Gets or sets the option to customize the series markers.

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

    It accepts ChartMarkerSettings.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:StackingAreaSeries ItemsSource = "{Binding Data}"
                                       XBindingPath = "XValue"
                                       YBindingPath = "YValue"
                                       ShowMarkers = "True">
                  <chart:StackingAreaSeries.MarkerSettings>
                        <chart:ChartMarkerSettings Fill = "Red" Height = "15" Width = "15"/>
                  </chart:StackingAreaSeries.MarkerSettings>
             </chart:StackingAreaSeries>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
       ChartMarkerSettings chartMarkerSettings = new ChartMarkerSettings()
       {
           Fill = new SolidColorBrush(Colors.Red),
           Height = 15,
           Width = 15,
       };
        StackingAreaSeries series = new StackingAreaSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ShowMarkers = true,
              MarkerSettings = chartMarkerSettings,
        };
    
        chart.Series.Add(series);

    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

    It accepts bool> values and its default value is false.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:StackingAreaSeries ItemsSource = "{Binding Data}"
                                       XBindingPath = "XValue"
                                       YBindingPath = "YValue"
                                       ShowMarkers = "True"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        StackingAreaSeries series = new StackingAreaSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ShowMarkers = true,
        };
    
        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()

    DrawMarker(ICanvas, Int32, ShapeType, Rect)

    Draws the markers for the stacking area series at each data point location on the chart.

    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

    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)

    See Also

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