Class StackedColumnSeries
The StackedColumnSeries is a special kind of column series which is similar to the regular column series except that the Y-values stack on top of each other.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public class StackedColumnSeries : StackedSeriesBase, ISupportAxes, ISegmentSelectable, ISegmentSpacing
Remarks
To render a series, create an instance of StackedColumnSeries class, and add it to the Series collection.
It provides options for Fill, PaletteBrushes, Stroke, 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 StackedColumnSeries 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 StackedColumnSeries 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
<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.YAxes>
<chart:StackedColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"/>
<chart:StackedColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue1"/>
</chart:SfCartesianChart>
Constructors
StackedColumnSeries()
Declaration
public StackedColumnSeries()
Fields
CustomTemplateProperty
Identifies the CustomTemplate dependency property.
Declaration
public static readonly DependencyProperty CustomTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for CustomTemplate dependency property. |
SegmentSpacingProperty
Identifies the SegmentSpacing dependency property.
Declaration
public static readonly DependencyProperty SegmentSpacingProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for SegmentSpacing dependency property. |
SelectionBehaviorProperty
The DependencyProperty for SelectionBehavior property. .
Declaration
public static readonly DependencyProperty SelectionBehaviorProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
Properties
CustomTemplate
Gets or sets the DataTemplate that can be used to customize the appearence of coulum shape.
Declaration
public DataTemplate CustomTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate | The template that specifies the shape inside the canvas. The default is null. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:StackedColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:StackedColumnSeries.CustomTemplate>
<DataTemplate>
<Canvas>
<Rectangle Fill = "{Binding Fill}" Width="{Binding Width}" Height="{Binding Height}"
Canvas.Left="{Binding RectX}" Canvas.Top="{Binding RectY}" Stroke="{Binding Stroke}"/>
</Canvas>
</DataTemplate>
</chart:StackedColumnSeries.CustomTemplate>
</chart:StackedColumnSeries>
</chart:SfCartesianChart>
SegmentSpacing
Gets or sets a value that can be used to change the spacing between two segments.
Declaration
public double SegmentSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts double values and the default value is 0. Here, the value ranges from 0 to 1. |
SelectionBehavior
Gets or sets a selection behavior that enables you to select or highlight a segment 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 segment, set the value for SelectionBrush property in DataPointSelectionBehavior class.
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:StackedColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:StackedColumnSeries.SelectionBehavior>
<chart:DataPointSelectionBehavior SelectionBrush = "Red" />
</chart:StackedColumnSeries.SelectionBehavior>
</chart:StackedColumnSeries>
</chart:SfCartesianChart>
See Also
Explicit Interface Implementations
ISegmentSpacing.CalculateSegmentSpacing(Double, Double, Double)
Method used to calculate the segment spacing.
Declaration
double ISegmentSpacing.CalculateSegmentSpacing(double spacing, double Right, double Left)
Parameters
Type | Name | Description |
---|---|---|
System.Double | spacing | Segment spacing value. |
System.Double | Right | Segment right value. |
System.Double | Left | Segment left value. |
Returns
Type | Description |
---|---|
System.Double | Returns the calculated segment space. |