WinUI

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class StackedLineSeries

    Show / Hide Table of Contents

    Class StackedLineSeries

    The StackedLineSeries is a special kind of line series which is similar to regular line series except that the Y-values stack on top of each other.

    Inheritance
    System.Object
    ChartSeries
    DataMarkerSeries
    CartesianSeries
    XyDataSeries
    StackedSeriesBase
    StackedLineSeries
    StackedLine100Series
    Implements
    ISupportAxes
    ISegmentSelectable
    Inherited Members
    StackedSeriesBase.GroupNameProperty
    StackedSeriesBase.GroupName
    XyDataSeries.YBindingPathProperty
    XyDataSeries.YBindingPath
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.ShowTrackballInfoProperty
    CartesianSeries.XAxisNameProperty
    CartesianSeries.YAxisNameProperty
    CartesianSeries.OnApplyTemplate()
    CartesianSeries.DataLabelSettings
    CartesianSeries.XAxisName
    CartesianSeries.YAxisName
    CartesianSeries.ShowTrackballInfo
    CartesianSeries.ISupportAxes.ActualXAxis
    CartesianSeries.ISupportAxes.ActualYAxis
    CartesianSeries.ISupportAxes.VisibleXRange
    CartesianSeries.ISupportAxes.VisibleYRange
    DataMarkerSeries.ShowDataLabelsProperty
    DataMarkerSeries.ShowDataLabels
    ChartSeries.SpacingProperty
    ChartSeries.TooltipTemplateProperty
    ChartSeries.EnableTooltipProperty
    ChartSeries.ListenPropertyChangeProperty
    ChartSeries.IsSeriesVisibleProperty
    ChartSeries.XBindingPathProperty
    ChartSeries.ItemsSourceProperty
    ChartSeries.TrackballLabelTemplateProperty
    ChartSeries.FillProperty
    ChartSeries.LabelProperty
    ChartSeries.LegendIconProperty
    ChartSeries.LegendIconTemplateProperty
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.EnableAnimationProperty
    ChartSeries.AnimationDurationProperty
    ChartSeries.PaletteBrushesProperty
    ChartSeries.StrokeProperty
    ChartSeries.StrokeThicknessProperty
    ChartSeries.SuspendNotification()
    ChartSeries.ResumeNotification()
    ChartSeries.OnPointerPressed(PointerRoutedEventArgs)
    ChartSeries.OnPointerMoved(PointerRoutedEventArgs)
    ChartSeries.OnTapped(TappedRoutedEventArgs)
    ChartSeries.OnPointerExited(PointerRoutedEventArgs)
    ChartSeries.OnPointerReleased(PointerRoutedEventArgs)
    ChartSeries.PaletteBrushes
    ChartSeries.TooltipTemplate
    ChartSeries.EnableTooltip
    ChartSeries.ListenPropertyChange
    ChartSeries.IsSeriesVisible
    ChartSeries.ItemsSource
    ChartSeries.TrackballLabelTemplate
    ChartSeries.Fill
    ChartSeries.Label
    ChartSeries.LegendIcon
    ChartSeries.LegendIconTemplate
    ChartSeries.IsVisibleOnLegend
    ChartSeries.XBindingPath
    ChartSeries.EnableAnimation
    ChartSeries.AnimationDuration
    ChartSeries.StrokeThickness
    ChartSeries.Chart
    ChartSeries.Stroke
    ChartSeries.PropertyChanged
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public class StackedLineSeries : StackedSeriesBase, ISupportAxes, ISegmentSelectable
    Remarks

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

    It provides options for Fill, PaletteBrushes, StrokeDashArray, StrokeThickness, and opacity to customize the appearance.

    EnableTooltip - A tooltip displays information while tapping or mouse hovering over a segment. To display the tooltip on chart, need to set the EnableTooltip property as true in StackedLineSeries 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 StackedLineSeries 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.

    Selection - To enable the data point selection in a chart, create an instance of DataPointSelectionBehavior and set it to the SelectionBehavior property of the chart series. To highlight the selected segment data label, set the value for SelectionBrush property in DataPointSelectionBehavior.

    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:StackedLineSeries ItemsSource="{Binding Data}"
                                       XBindingPath="XValue"
                                       YBindingPath="YValue"/>
    
              <chart:StackedLineSeries ItemsSource="{Binding Data}"
                                       XBindingPath="XValue"
                                       YBindingPath="YValue1"/>
    
        </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();
    
        StackedLineSeries series = new StackedLineSeries();
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        chart.Series.Add(series);
    
        StackedLineSeries series1 = new StackedLineSeries();
        series1.ItemsSource = viewModel.Data;
        series1.XBindingPath = "XValue";
        series1.YBindingPath = "YValue1";
        chart.Series.Add(series1); 
        public ObservableCollection<Model> Data { get; set; }
    
        public ViewModel()
        {
           Data = new ObservableCollection<Model>();
           Data.Add(new Model() { XValue = 10, YValue = 100, YValue1 = 110 });
           Data.Add(new Model() { XValue = 20, YValue = 150, YValue1 = 100 });
           Data.Add(new Model() { XValue = 30, YValue = 110, YValue1 = 130 });
           Data.Add(new Model() { XValue = 40, YValue = 230, YValue1 = 180 });
        }

    Constructors

    StackedLineSeries()

    Declaration
    public StackedLineSeries()

    Fields

    SelectionBehaviorProperty

    The DependencyProperty for SelectionBehavior property. .

    Declaration
    public static readonly DependencyProperty SelectionBehaviorProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    StrokeDashArrayProperty

    Identifies the StrokeDashArray dependency property.

    Declaration
    public static readonly DependencyProperty StrokeDashArrayProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for StrokeDashArray dependency property.

    Properties

    SelectionBehavior

    Gets or sets a selection behavior that enables you to select or highlight a data point in a series.

    Declaration
    public DataPointSelectionBehavior SelectionBehavior { get; set; }
    Property Value
    Type Description
    DataPointSelectionBehavior

    This property takes the DataPointSelectionBehavior instance as a value, and its default value is null.

    Remarks

    To highlight the selected data point, set the value for the SelectionBrush property in the DataPointSelectionBehavior class.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
             <!-- ... Eliminated for simplicity-->
             <chart:StackedLineSeries ItemsSource="{Binding Data}"
                                      XBindingPath="XValue"
                                      YBindingPath="YValue">
                 <chart:StackedLineSeries.SelectionBehavior>
                     <chart:DataPointSelectionBehavior SelectionBrush = "Red" />
                 </chart:StackedLineSeries.SelectionBehavior>
             </chart:StackedLineSeries>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
       <!-- ... Eliminated for simplicity-->
    
        StackedLineSeries series = new StackedLineSeries();
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        series.SelectionBehavior = new DataPointSelectionBehavior()
        {
           SelectionBrush = new SolidColorBrush(Colors.Red),
        };
        chart.Series.Add(series);
    See Also
    SelectedIndex
    SelectionBrush
    SelectionChanging
    SelectionChanged

    StrokeDashArray

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

    Declaration
    public DoubleCollection StrokeDashArray { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.DoubleCollection

    It accepts the Microsoft.UI.Xaml.Media.DoubleCollection value and the default value is null.

    Implements

    ISupportAxes
    ISegmentSelectable

    See Also

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