Class ChartSeries
Implements
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public abstract class ChartSeries : Control, INotifyPropertyChanged
Constructors
ChartSeries()
Initializes a new instance of the ChartSeries.
Declaration
public ChartSeries()
Fields
AnimationDurationProperty
Identifies the AnimationDuration dependency property.
Declaration
public static readonly DependencyProperty AnimationDurationProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
EnableAnimationProperty
Identifies the EnableAnimation dependency property.
Declaration
public static readonly DependencyProperty EnableAnimationProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
EnableTooltipProperty
Identifies the EnableTooltip dependency property.
Declaration
public static readonly DependencyProperty EnableTooltipProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
FillProperty
Identifies the Fill dependency property.
Declaration
public static readonly DependencyProperty FillProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
IsSeriesVisibleProperty
Identifies the IsSeriesVisible dependency property.
Declaration
public static readonly DependencyProperty IsSeriesVisibleProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
IsVisibleOnLegendProperty
Identifies the IsVisibleOnLegend dependency property.
Declaration
public static readonly DependencyProperty IsVisibleOnLegendProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
LabelProperty
Identifies the Label dependency property.
Declaration
public static readonly DependencyProperty LabelProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
LegendIconProperty
Identifies the LegendIcon dependency property.
Declaration
public static readonly DependencyProperty LegendIconProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
LegendIconTemplateProperty
Identifies the LegendIconTemplate dependency property.
Declaration
public static readonly DependencyProperty LegendIconTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
ListenPropertyChangeProperty
Identifies the ListenPropertyChange dependency property.
Declaration
public static readonly DependencyProperty ListenPropertyChangeProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
PaletteBrushesProperty
Identifies the PaletteBrushes dependency property.
Declaration
public static readonly DependencyProperty PaletteBrushesProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
SelectionBehaviorProperty
The DependencyProperty for SelectionBehavior property. .
Declaration
public static readonly DependencyProperty SelectionBehaviorProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ShowDataLabelsProperty
Identifies the ShowDataLabels dependency property.
Declaration
public static readonly DependencyProperty ShowDataLabelsProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
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 |
TooltipTemplateProperty
Identifies the TooltipTemplate dependency property.
Declaration
public static readonly DependencyProperty TooltipTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
TrackballLabelTemplateProperty
Identifies the TrackballLabelTemplate dependency property.
Declaration
public static readonly DependencyProperty TrackballLabelTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
XBindingPathProperty
Identifies the XBindingPath dependency property.
Declaration
public static readonly DependencyProperty XBindingPathProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for |
Properties
ActualXAxis
Gets the actual XAxis value.
Declaration
public ChartAxis ActualXAxis { get; }
Property Value
Type |
---|
ChartAxis |
ActualYAxis
Gets the actual YAxis value.
Declaration
public ChartAxis ActualYAxis { get; }
Property Value
Type |
---|
ChartAxis |
AnimationDuration
Gets or sets a value to indicate the timeline for the animation.
Declaration
public TimeSpan AnimationDuration { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | It accepts System.TimeSpan value and its default value is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EnableAnimation = "True"
AnimationDuration="00:00:02"/>
</chart:SfCartesianChart>
Chart
Gets the ChartBase instance.
Declaration
public ChartBase Chart { get; }
Property Value
Type |
---|
ChartBase |
EnableAnimation
Gets or sets a boolean value indicating whether to animate the chart series on loading.
Declaration
public bool EnableAnimation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts bool values and its default value is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EnableAnimation = "True"/>
</chart:SfCartesianChart>
EnableTooltip
Gets or sets a boolean value indicating whether the tooltip for series should be shown or hidden.
Declaration
public bool EnableTooltip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts bool values and its default value is |
Remarks
The series tooltip will appear when you click or tap the series area.
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EnableTooltip="True"/>
</chart:SfCartesianChart>
Fill
Gets or sets a brush value to customize the series appearance.
Declaration
public Brush Fill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.Media.Brush | It accepts a Microsoft.UI.Xaml.Media.Brush value and its default value is null. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
Fill = "Red"/>
</chart:SfCartesianChart>
IsSeriesVisible
Gets or sets a value that indicates whether the series is visible or not.
Declaration
public bool IsSeriesVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts bool values and its default value is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
IsSeriesVisible="False"/>
</chart:SfCartesianChart>
IsVisibleOnLegend
Gets or sets a value that indicates whether to show a legend item for this series.
Declaration
public bool IsVisibleOnLegend { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts bool values and its default value is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Legend>
<chart:ChartLegend />
</chart:SfCartesianChart.Legend>
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
IsVisibleOnLegend = "False"/>
</chart:SfCartesianChart>
ItemsSource
Gets or sets a data points collection that will be used to plot a chart.
Declaration
public object ItemsSource { get; set; }
Property Value
Type |
---|
System.Object |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue" />
</chart:SfCartesianChart>
Label
Gets or sets a value that will be displayed in the associated legend item.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String | It accepts a string value and its default value is string.Empty. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
Label = "ColumnSeries"/>
</chart:SfCartesianChart>
LegendIcon
Gets or sets a legend icon that will be displayed in the associated legend item.
Declaration
public ChartLegendIcon LegendIcon { get; set; }
Property Value
Type | Description |
---|---|
ChartLegendIcon | It accepts ChartLegendIcon values and its default value is SeriesType. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Legend>
<chart:ChartLegend />
</chart:SfCartesianChart.Legend>
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
LegendIcon = "Diamond"/>
</chart:SfCartesianChart>
LegendIconTemplate
Gets or sets a template to customize the legend icon that appears in the associated legend item.
Declaration
public DataTemplate LegendIconTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate | It accepts Microsoft.UI.Xaml.DataTemplate value and its default value is null. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.Legend>
<chart:ChartLegend />
</chart:SfCartesianChart.Legend>
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:ColumnSeries.LegendIconTemplate>
<DataTemplate x:Key="iconTemplate">
<Ellipse Height = "10" Width="10"
Fill="White" Stroke="#4a4a4a"
StrokeWidth="2"/>
</DataTemplate>
</chart:ColumnSeries.LegendIconTemplate>
</chart:ColumnSeries>
</chart:SfCartesianChart>
ListenPropertyChange
Gets or sets a value that indicates whether to listen property change or not.
Declaration
public bool ListenPropertyChange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts bool values and its default value is |
PaletteBrushes
Gets or sets the list of brushes that can be used to customize the appearance of the series.
Declaration
public IList<Brush> PaletteBrushes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Microsoft.UI.Xaml.Media.Brush> | This property accepts a list of brushes as input and comes with a set of predefined brushes by default. |
Remarks
It allows custom brushes, and gradient brushes to customize the appearance.
Examples
<Grid>
<Grid.Resources>
<BrushCollection x:Key="customBrushes">
<SolidColorBrush Color="#4dd0e1"/>
<SolidColorBrush Color="#26c6da"/>
<SolidColorBrush Color="#00bcd4"/>
<SolidColorBrush Color="#00acc1"/>
<SolidColorBrush Color="#0097a7"/>
<SolidColorBrush Color="#00838f"/>
</BrushCollection>
</Grid.Resources>
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource = "{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
PaletteBrushes="{StaticResource customBrushes}" />
</chart:SfCartesianChart>
</Grid>
SelectionBehavior
Gets or sets a selection behavior that enables you to select or highlight a segment in the series.
Declaration
public DataPointSelectionBehavior SelectionBehavior { get; set; }
Property Value
Type | Description |
---|---|
DataPointSelectionBehavior | This property takes the aDataPointSelectionBehavior 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
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:PieSeries.SelectionBehavior>
<chart:DataPointSelectionBehavior SelectionBrush = "Red" />
</chart:PieSeries.SelectionBehavior>
</chart:PieSeries>
</chart:SfCircularChart>
See Also
ShowDataLabels
Gets or sets a value that indicates to enable the data labels for the series.
Declaration
public bool ShowDataLabels { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts bool values and the default value is |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True"/>
</chart:SfCartesianChart>
TooltipTemplate
Gets or sets the DataTemplate that can be used to customize the appearance of the tooltip.
Declaration
public DataTemplate TooltipTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate | It accepts a Microsoft.UI.Xaml.DataTemplate value. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EnableTooltip="True" >
<chart:ColumnSeries.TooltipTemplate>
<DataTemplate>
<Border Background = "DarkGreen"
CornerRadius="5"
BorderThickness="2"
BorderBrush="Black"
Width="50" Height="30">
<TextBlock Text = "{Binding Item.YValue}"
Foreground="White"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</DataTemplate>
</chart:ColumnSeries.TooltipTemplate>
</chart:ColumnSeries>
</chart:SfCartesianChart>
TrackballLabelTemplate
Gets or sets the custom template to customize the appearance of the chart series trackball label.
Declaration
public DataTemplate TrackballLabelTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate | It accepts a Microsoft.UI.Xaml.DataTemplate value. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior />
</chart:SfCartesianChart.TrackballBehavior>
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:ColumnSeries.TrackballLabelTemplate>
<DataTemplate>
<Border CornerRadius = "5" BorderThickness="1"
BorderBrush="Black" Background="LightGreen" Padding="5">
<TextBlock Foreground = "Black" Text="{Binding ValueY}"/>
</Border>
</DataTemplate>
</chart:ColumnSeries.TrackballLabelTemplate>
</chart:ColumnSeries>
</chart:SfCartesianChart>
XBindingPath
Gets or sets a path value on the source object to serve a x value to the series.
Declaration
public string XBindingPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The string that represents the property name for the x plotting data, and its default value is null. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue" />
</chart:SfCartesianChart>
Methods
OnApplyTemplate()
Declaration
protected override void OnApplyTemplate()
OnPointerExited(PointerRoutedEventArgs)
Declaration
protected override void OnPointerExited(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnPointerMoved(PointerRoutedEventArgs)
Declaration
protected override void OnPointerMoved(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnPointerPressed(PointerRoutedEventArgs)
Declaration
protected override void OnPointerPressed(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnPointerReleased(PointerRoutedEventArgs)
Declaration
protected override void OnPointerReleased(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnTapped(TappedRoutedEventArgs)
Declaration
protected override void OnTapped(TappedRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.TappedRoutedEventArgs | e |
ResumeNotification()
Processes the data that is added to the data source after SuspendNotification.
Declaration
public void ResumeNotification()
SuspendNotification()
Suspends the series from updating the series data until ResumeNotification is called.
Declaration
public void SuspendNotification()
Remarks
This is specifically used when we need to append a collection of data.
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |