menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class StackingColumnSeries - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class StackingColumnSeries

    The StackingColumnSeries is a chart type that shows a set of vertical bars stacked on top of each other to represent data point values.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    XYDataSeries
    StackingSeriesBase
    StackingColumnSeries
    StackingColumn100Series
    Inherited Members
    CartesianSeries.ActualXAxis
    CartesianSeries.ActualYAxis
    CartesianSeries.DataLabelSettings
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.GetDataPoints(Double, Double, Double, Double)
    CartesianSeries.GetDataPoints(Rect)
    CartesianSeries.Label
    CartesianSeries.LabelProperty
    CartesianSeries.OnBindingContextChanged()
    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.GetDataPointIndex(Single, Single)
    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.OnParentSet()
    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.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class StackingColumnSeries : StackingSeriesBase, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon, ISBSDependent
    Remarks

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

    It provides options for Fill, PaletteBrushes, StrokeWidth, Stroke, 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 StackingColumnSeries 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 StackingColumnSeries 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.

    Spacing - To specify the spacing between segments using the Spacing 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:StackingColumnSeries
                      ItemsSource="{Binding Data}"
                      XBindingPath="XValue"
                      YBindingPath="YValue"/>
    
                  <chart:StackingColumnSeries
                      ItemsSource="{Binding Data_1}"
                      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();
    
        StackingColumnSeries series = new StackingColumnSeries();
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
    
        StackingColumnSeries series_1 = new StackingColumnSeries();
        series.ItemsSource = viewModel.Data_1;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
    
        chart.Series.Add(series);
        chart.Series.Add(series_1);
        public ObservableCollection<Model> Data { get; set; }
        public ObservableCollection<Model> Data_1 { 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 });
    
           Data_1 = new ObservableCollection<Model>();
           Data_1.Add(new Model() { XValue = 50, YValue = 250 });
           Data_1.Add(new Model() { XValue = 60, YValue = 270 });
           Data_1.Add(new Model() { XValue = 70, YValue = 280 });
           Data_1.Add(new Model() { XValue = 80, YValue = 310 });
        }

    Constructors

    StackingColumnSeries()

    Declaration
    public StackingColumnSeries()

    Fields

    CornerRadiusProperty

    Identifies the CornerRadius bindable property.

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

    SpacingProperty

    Identifies the Spacing bindable property.

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

    WidthProperty

    Identifies the Width bindable property

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

    Properties

    CornerRadius

    Gets or sets the value for the corner radius that helps to smooth column edges in stacking column series.

    Declaration
    public CornerRadius CornerRadius { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.CornerRadius

    It accepts Microsoft.Maui.CornerRadius value, and its default value is null.

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

    Spacing

    Gets or sets a value to indicate spacing between the segments across the series.

    Declaration
    public double Spacing { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts double values and the default value is 0. Here, the value is between 0 and 1.

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

    Width

    Gets or sets a value to change the width of the rectangle.

    Declaration
    public double Width { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts double values and the default value is 0.8. Here, the value is between 0 and 1.

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

    Methods

    CreateSegment()

    This method used to create the segment for the series.

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

    See Also

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