WinUI

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartSeriesBase - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartSeriesBase

    Represents a base class for all the series types in chart.

    Inheritance
    System.Object
    ChartSeriesBase
    ChartSeries
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public abstract class ChartSeriesBase : Control
    Remarks

    Data points for ChartSeries would be populated ChartSeriesBase from ItemsSource property. Specify the binding paths for X-Values and Y-Values. The number of Y-Values may vary depending on the type of series. For e.g LineSeries requires only one y-value, whereas CandleSeries requires four y-values to plot a point.

    Constructors

    ChartSeriesBase()

    Called when instance created for ChartSeries

    Declaration
    public ChartSeriesBase()

    Fields

    AnimationDurationProperty

    Identifies the AnimationDuration dependency property.

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

    The identifier for AnimationDuration dependency property.

    ChartTransformer

    ChartTransformer variable declarations

    Declaration
    protected IChartTransformer ChartTransformer
    Field Value
    Type Description
    Syncfusion.UI.Xaml.Charts.IChartTransformer

    ColorModelProperty

    Identifies the ColorModel dependency property.

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

    The identifier for ColorModel dependency property.

    EnableAnimationProperty

    Identifies the EnableAnimation dependency property.

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

    The identifier for EnableAnimation dependency property.

    InitialDelayTimer

    Timer to handle the initial delay of showing the tooltip.

    Declaration
    protected DispatcherTimer InitialDelayTimer
    Field Value
    Type Description
    Microsoft.UI.Xaml.DispatcherTimer

    InteriorProperty

    Identifies the Interior dependency property.

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

    The identifier for Interior dependency property.

    IsSeriesVisibleProperty

    Identifies the IsSeriesVisible dependency property.

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

    The identifier for IsSeriesVisible dependency property.

    ItemsSourceProperty

    Identifies the ItemsSource dependency property.

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

    The identifier for ItemsSource dependency property.

    LabelProperty

    Identifies the Label dependency property.

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

    The identifier for Label dependency property.

    LegendIconProperty

    Identifies the LegendIcon dependency property.

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

    The identifier for LegendIcon dependency property.

    LegendIconTemplateProperty

    Identifies the LegendIconTemplate dependency property.

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

    The identifier for LegendIconTemplate dependency property.

    ListenPropertyChangeProperty

    Identifies the ListenPropertyChange dependency property.

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

    The identifier for ListenPropertyChange dependency property.

    PaletteProperty

    Identifies the Palette dependency property.

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

    The identifier for Palette dependency property.

    SegmentColorPathProperty

    Identifies the SegmentColorPath dependency property.

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

    The identifier for SegmentColorPath dependency property.

    Segments

    segments variable declarations

    Declaration
    protected ObservableCollection<ChartSegment> Segments
    Field Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<ChartSegment>

    ShowTooltipProperty

    Identifies the ShowTooltip dependency property.

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

    The identifier for ShowTooltip dependency property.

    SpacingProperty

    Identifies the Spacing dependency property. This is attached property.

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

    The identifier for Spacing dependency property.

    Timer

    Timer to handle the show duration of the tooltip.

    Declaration
    protected DispatcherTimer Timer
    Field Value
    Type Description
    Microsoft.UI.Xaml.DispatcherTimer

    TooltipTemplateProperty

    Identifies the TooltipTemplate dependency property.

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

    The identifier for TooltipTemplate dependency property.

    TrackballLabelTemplateProperty

    Identifies the TrackballLabelTemplate dependency property.

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

    The identifier for TrackballLabelTemplate dependency property.

    VisibilityOnLegendProperty

    Identifies the VisibilityOnLegend dependency property.

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

    The identifier for VisibilityOnLegend dependency property.

    XBindingPathProperty

    Identifies the XBindingPath dependency property.

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

    The identifier for XBindingPath dependency property.

    YPaths

    YPaths variable declarations

    Declaration
    protected string[] YPaths
    Field Value
    Type Description
    System.String[]

    Properties

    ActualXAxis

    Gets actual series X-axis.

    Declaration
    protected ChartAxis ActualXAxis { get; }
    Property Value
    Type Description
    ChartAxis
    Remarks

    Gets actual XAxis for series with respect to chart type and Syncfusion.UI.Xaml.Charts.ChartSeriesBase.IsActualTransposed value.

    ActualXValues

    Gets or sets the sorted values, if the IsSortData is true.

    Declaration
    protected IEnumerable ActualXValues { get; set; }
    Property Value
    Type Description
    System.Collections.IEnumerable

    ActualYAxis

    Gets actual series Y-axis.

    Declaration
    protected ChartAxis ActualYAxis { get; }
    Property Value
    Type Description
    ChartAxis

    AnimationDuration

    Gets or sets the duration of the animation.

    Declaration
    public TimeSpan AnimationDuration { get; set; }
    Property Value
    Type Description
    System.TimeSpan

    System.TimeSpan

    Examples
      <syncfusion:ColumnSeries ItemsSource="{Binding Demands} AnimationDuration="00:00:03" XBindingPath="Demand" YBindingPath="Year2010">
      </syncfusion:ColumnSeries>

    ColorModel

    Gets or sets the color models for all series in the chart.

    Declaration
    public ChartColorModel ColorModel { get; set; }
    Property Value
    Type Description
    ChartColorModel

    ChartColorModel

    ColorValues

    Gets or sets a series color values.

    Declaration
    protected IList<Brush> ColorValues { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IList<Microsoft.UI.Xaml.Media.Brush>

    DataCount

    Gets the number of points given as input.

    Declaration
    public int DataCount { get; }
    Property Value
    Type Description
    System.Int32

    EnableAnimation

    Gets or sets a value indicating whether to animate the chart series on loading and whenever ItemsSource change.

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

    Interior

    Gets or sets the brush to paint the interior of the series.

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

    The Microsoft.UI.Xaml.Media.Brush value.

    IsColorPathSeries

    This indicates whether its a colorpath series or not.

    Declaration
    protected bool IsColorPathSeries { get; }
    Property Value
    Type Description
    System.Boolean

    IsIndexed

    Gets or sets a value indicating whether to treat x values as categories.

    Declaration
    protected bool IsIndexed { get; }
    Property Value
    Type Description
    System.Boolean

    IsSeriesVisible

    Gets or sets a value indicating whether is series visible.

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

    IsStacked

    Gets a value indicating whether this series is a stacked series.

    Declaration
    protected virtual bool IsStacked { get; }
    Property Value
    Type Description
    System.Boolean

    true if the series is one of stacked series; otherwise, false. The default value is true.

    ItemsSource

    Gets or sets a collection of data points used to generate Chart.

    Declaration
    public object ItemsSource { get; set; }
    Property Value
    Type Description
    System.Object

    The ItemsSource value.

    Label

    Gets or sets the label that will be displayed in the associated legend item.

    Declaration
    public string Label { get; set; }
    Property Value
    Type Description
    System.String

    LegendIcon

    Gets or sets ChartLegendIcon to be displayed in associated legend item.

    Declaration
    public ChartLegendIcon LegendIcon { get; set; }
    Property Value
    Type Description
    ChartLegendIcon

    ChartLegendIcon

    LegendIconTemplate

    Gets or sets DataTemplate for legend icon.

    Declaration
    public DataTemplate LegendIconTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    Microsoft.UI.Xaml.DataTemplate

    ListenPropertyChange

    Gets or sets a value that indicates whether to listen property change or not. This is a bindable property.

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

    Palette

    Gets or sets ChartPalette for series.

    Declaration
    public ChartColorPalette Palette { get; set; }
    Property Value
    Type Description
    ChartColorPalette

    SegmentColorPath

    Gets or sets the property binding path for segment color.

    Declaration
    public string SegmentColorPath { get; set; }
    Property Value
    Type Description
    System.String

    SelectedSegment

    Returns the corresponding series selected segment.

    Declaration
    protected virtual ChartSegment SelectedSegment { get; }
    Property Value
    Type Description
    ChartSegment

    SelectedSegments

    Gets the selected segments in this series, when we enable the multiple selection.

    Declaration
    protected virtual List<ChartSegment> SelectedSegments { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<ChartSegment>

    It returns list of ChartSegment.

    SelectedSegmentsIndexes

    Gets or sets the selected segments indexes.

    Declaration
    protected ObservableCollection<int> SelectedSegmentsIndexes { get; set; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<System.Int32>

    ShowTooltip

    Gets or sets a value indicating whether to show or hide the tooltip for series.

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

    TooltipTemplate

    Gets or sets the custom template for Tooltip.

    Declaration
    public DataTemplate TooltipTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    This accepts a Microsoft.UI.Xaml.DataTemplate.

    Examples
      <syncfusion:ColumnSeries ShowTooltip="True" ItemsSource="{Binding Demands} syncfusion:ChartTooltip.VerticalAlignment="Top" XBindingPath="Demand" YBindingPath="Year2010">
         <syncfusion:ColumnSeries.TooltipTemplate>
           <DataTemplate>
               <Border Background = "DarkGreen" CornerRadius="5" BorderThickness="2" BorderBrush="Black" Width="50" Height="30">
                   <TextBlock Text = "{Binding Item.Year2010}" Foreground="White" FontWeight="Bold"  HorizontalAlignment="Center" VerticalAlignment="Center"/>
               </Border>
           </DataTemplate>
         </syncfusion:ColumnSeries.TooltipTemplate>
      </syncfusion:ColumnSeries>

    TrackballLabelTemplate

    Gets or sets DataTemplate used to display label, when ChartTrackballBehavior is used.

    Declaration
    public DataTemplate TrackballLabelTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    Microsoft.UI.Xaml.DataTemplate

    Examples
      <syncfusion:ColumnSeries ItemsSource="{Binding Demands} XBindingPath="Demand" YBindingPath="Year2010">
         <syncfusion:ColumnSeries.TrackBallLabelTemplate>
           <DataTemplate>
               <Border Background = "DarkGreen" CornerRadius="5" BorderThickness="2" BorderBrush="Black" Width="50" Height="30">
                   <TextBlock Text = "{Binding Item.Year2010}" Foreground="White" FontWeight="Bold"  HorizontalAlignment="Center" VerticalAlignment="Center"/>
               </Border>
           </DataTemplate>
         </syncfusion:ColumnSeries.TrackBallLabelTemplate>
      </syncfusion:ColumnSeries>

    VisibilityOnLegend

    Gets or sets a value that determines whether to create a legend item for this series. By default, legend item will be visible for this series.

    Declaration
    public Visibility VisibilityOnLegend { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Visibility

    Microsoft.UI.Xaml.Visibility

    XBindingPath

    Gets or sets the property path of x-data in ItemsSource to render the chart series. This is a bindable property.

    Declaration
    public string XBindingPath { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    ClearUnUsedSegments(Int32)

    Method implementation for clear unused segments.

    Declaration
    protected virtual void ClearUnUsedSegments(int startIndex)
    Parameters
    Type Name Description
    System.Int32 startIndex

    CreateSegments()

    An abstract method which will be called over to create segments.

    Declaration
    public abstract void CreateSegments()

    CreateTransformer(Size, Boolean)

    Return IChartTranform value based upon the given size.

    Declaration
    protected virtual IChartTransformer CreateTransformer(Size size, bool create)
    Parameters
    Type Name Description
    Windows.Foundation.Size size

    Size of the panel.

    System.Boolean create

    Used to specify whether to create the charttransform for not.

    Returns
    Type Description
    Syncfusion.UI.Xaml.Charts.IChartTransformer

    returns IChartTransformer

    GeneratePoints()

    method declaration for generatepoints in Chartseries

    Declaration
    protected abstract void GeneratePoints()

    GeneratePoints(String[], IList<Double>[])

    Method used to generate data points for ChartSeries.

    Declaration
    protected void GeneratePoints(string[] yPaths, params IList<double>[] yValueLists)
    Parameters
    Type Name Description
    System.String[] yPaths

    Y paths

    System.Collections.Generic.IList<System.Double>[] yValueLists

    YValues list

    GetSideBySideInfo(ChartSeriesBase)

    Returns the value of side by side position for a series.

    Declaration
    public DoubleRange GetSideBySideInfo(ChartSeriesBase currentseries)
    Parameters
    Type Name Description
    ChartSeriesBase currentseries

    ChartSeries.

    Returns
    Type Description
    DoubleRange

    The DoubleRange side by side Info

    GetXValues()

    Return collection of double values

    Declaration
    protected List<double> GetXValues()
    Returns
    Type Description
    System.Collections.Generic.List<System.Double>

    Invalidate()

    Invalidates the Series.

    Declaration
    public void Invalidate()

    OnApplyTemplate()

    Invoke to render chart series.

    Declaration
    protected override void OnApplyTemplate()

    OnBindingPathChanged(DependencyPropertyChangedEventArgs)

    Invoked when XBindingPath or YBindingPath properties changed.

    Declaration
    protected virtual void OnBindingPathChanged(DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DependencyPropertyChangedEventArgs args

    The Microsoft.UI.Xaml.DependencyPropertyChangedEventArgs that contains the event data

    OnDataSourceChanged(DependencyPropertyChangedEventArgs)

    Called when ItemsSource property changed.

    Declaration
    protected void OnDataSourceChanged(DependencyPropertyChangedEventArgs args)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DependencyPropertyChangedEventArgs args

    OnDataSourceChanged(IEnumerable, IEnumerable)

    Invoked when ItemsSource property changed.

    Declaration
    protected virtual void OnDataSourceChanged(IEnumerable oldValue, IEnumerable newValue)
    Parameters
    Type Name Description
    System.Collections.IEnumerable oldValue

    Old itemssource collection.

    System.Collections.IEnumerable newValue

    New itemssource collection.

    See Also
    XBindingPath
    YBindingPath

    OnPointerExited(PointerRoutedEventArgs)

    Called when pointer leave from segment.

    Declaration
    protected override void OnPointerExited(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    MouseEventArgs

    OnPointerMoved(PointerRoutedEventArgs)

    Called when mouse or pointer move to show the tooltip for series.

    Declaration
    protected override void OnPointerMoved(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    Event Arguments

    OnPointerPressed(PointerRoutedEventArgs)

    Called when pointer or mouse pressed.

    Declaration
    protected override void OnPointerPressed(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    EventArgs

    OnPointerReleased(PointerRoutedEventArgs)

    When tap release it will fire.

    Declaration
    protected override void OnPointerReleased(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    OnSeriesMouseDown(Object, Point)

    Called when the chart mouse down.

    Declaration
    protected virtual void OnSeriesMouseDown(object source, Point position)
    Parameters
    Type Name Description
    System.Object source

    source

    Windows.Foundation.Point position

    position

    OnSeriesMouseUp(Object, Point)

    Called when the chart mouse up.

    Declaration
    protected virtual void OnSeriesMouseUp(object source, Point position)
    Parameters
    Type Name Description
    System.Object source

    source

    Windows.Foundation.Point position

    position

    OnTapped(TappedRoutedEventArgs)

    Used to update the series tooltip when tapping on the series segments.

    Declaration
    protected override void OnTapped(TappedRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e

    TappedRoutedEventArgs

    Position(Point, ref ChartTooltip)

    Set the Horizontal and Vertical Alignment for Tooltip.

    Declaration
    protected Point Position(Point mousePos, ref ChartTooltip tooltip)
    Parameters
    Type Name Description
    Windows.Foundation.Point mousePos

    Current Position

    ChartTooltip tooltip

    Tooltip instance

    Returns
    Type Description
    Windows.Foundation.Point

    ResumeNotification()

    Processes the data that is added to data source after SuspendNotification.

    Declaration
    public void ResumeNotification()

    SelectedIndexChanged(Int32, Int32)

    Method used to set SegmentSelectionBrush to selectedindex chartsegment.

    Declaration
    protected virtual void SelectedIndexChanged(int newIndex, int oldIndex)
    Parameters
    Type Name Description
    System.Int32 newIndex

    new index

    System.Int32 oldIndex

    old index

    SetDoubleAnimation(ChartTooltip)

    Set animation for tooltip.

    Declaration
    protected virtual void SetDoubleAnimation(ChartTooltip chartTooltip)
    Parameters
    Type Name Description
    ChartTooltip chartTooltip

    ChartTooltip

    SetIndividualDataTablePoint(Int32, Object, Boolean)

    Method implementation for Set points to given index for data table.

    Declaration
    protected virtual void SetIndividualDataTablePoint(int index, object obj, bool replace)
    Parameters
    Type Name Description
    System.Int32 index

    index

    System.Object obj

    object

    System.Boolean replace

    replace the data point or not

    SetIndividualPoint(Int32, Object, Boolean)

    Method implementation for generate points to given index.

    Declaration
    protected virtual void SetIndividualPoint(int index, object obj, bool replace)
    Parameters
    Type Name Description
    System.Int32 index

    index

    System.Object obj

    object

    System.Boolean replace

    replace the data or not

    SetTooltipDuration()

    Set ToolTip duration.

    Declaration
    protected virtual void SetTooltipDuration()

    SuspendNotification()

    Suspends the series from updating the series data till ResumeNotification is called. This is specifically used when we need to append collection of datas.

    Declaration
    public void SuspendNotification()

    UpdateArea()

    Method implementation for UpdateArea.

    Declaration
    protected void UpdateArea()

    UpdateSegments(Int32, NotifyCollectionChangedAction)

    An abstract method which will called over each time in its child class to update an segment.

    Declaration
    public virtual void UpdateSegments(int index, NotifyCollectionChangedAction action)
    Parameters
    Type Name Description
    System.Int32 index

    The index of the segment

    System.Collections.Specialized.NotifyCollectionChangedAction action

    The collection changed action which raises the notification

    Events

    PropertyChanged

    Event correspond to property value changed. It invokes when the ChartSeriesBase properties changed.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler

    See Also

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