Class StackingBarSeries
StackingBarSeries is typically preferred in cases of multiple series of type BarSeries. Each series is stacked horizontally side by side to each other.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.UWP.dll
Syntax
public class StackingBarSeries : StackingSeriesBase, ICloneable, ISupportAxes2D, ISupportAxes, ISegmentSelectable, ISegmentSpacing
Examples
<syncfusion:StackingBarSeries ItemsSource="{Binding Data}" XBindingPath="Year" YBindingPath="Value">
</syncfusion:StackingBarSeries>
StackingBarSeries series1 = new StackingBarSeries();
series1.ItemsSource = viewmodel.Data;
series1.XBindingPath = "Year";
series1.YBindingPath = "Value";
chart.Series.Add(series1);
Constructors
StackingBarSeries()
Called when instance created for StackingBarSeries
Declaration
public StackingBarSeries()
Fields
CustomTemplateProperty
The DependencyProperty for CustomTemplate property. .
Declaration
public static readonly DependencyProperty CustomTemplateProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty |
SegmentSelectionBrushProperty
The DependencyProperty for SegmentSelectionBrush property.
Declaration
public static readonly DependencyProperty SegmentSelectionBrushProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty |
SegmentSpacingProperty
The DependencyProperty for SegmentSpacing property.
Declaration
public static readonly DependencyProperty SegmentSpacingProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty |
SelectedIndexProperty
The DependencyProperty for SelectedIndex property. .
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type | Description |
---|---|
Windows.UI.Xaml.DependencyProperty |
Properties
CustomTemplate
Gets or sets the custom template for this series.
Declaration
public DataTemplate CustomTemplate { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.DataTemplate |
Examples
This example, we are using ScatterSeries.
<syncfusion:ScatterSeries ItemsSource="{Binding Demands}" XBindingPath="Demand" ScatterHeight="40"
YBindingPath="Year2010" ScatterWidth="40">
<syncfusion:ScatterSeries.CustomTemplate>
<DataTemplate>
<Canvas>
<Path Data="M20.125,32l0.5,12.375L10.3125,12.375L10.3125,0.5L29.9375,0.5L29.9375,12.375L39.75,12.375Z" Stretch="Fill"
Fill="{Binding Interior}" Height="{Binding ScatterHeight}" Width="{Binding ScatterWidth}"
Canvas.Left="{Binding RectX}" Canvas.Top="{Binding RectY}"/>
</Canvas>
</DataTemplate>
</syncfusion:ScatterSeries.CustomTemplate>
</syncfusion:ScatterSeries>
IsSideBySide
Gets a value indicating whether this series is placed side by side.
Declaration
protected override bool IsSideBySide { get; }
Property Value
Type | Description |
---|---|
System.Boolean | It returns |
Overrides
IsStacked
This indicates whether this series is stacked or not.
Declaration
protected override bool IsStacked { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
SegmentSelectionBrush
Gets or sets the interior(brush) for the selected segment(s).
Declaration
public Brush SegmentSelectionBrush { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.Media.Brush | The Windows.UI.Xaml.Media.Brush value. |
SegmentSpacing
Gets or sets the spacing between the segments across the series in cluster mode.
Declaration
public double SegmentSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The value ranges from 0 to 1 and its default value is 0. |
SelectedIndex
Gets or sets the index of the selected segment.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
|
See Also
Methods
CalculateSegmentSpacing(Double, Double, Double)
Method used to calculate the segment spacing.
Declaration
protected double CalculateSegmentSpacing(double spacing, double Right, double Left)
Parameters
Type | Name | Description |
---|---|---|
System.Double | spacing | |
System.Double | Right | Right |
System.Double | Left | Left |
Returns
Type | Description |
---|---|
System.Double |
CloneSeries(DependencyObject)
Returns the instance of StackingBarSeries series.
Declaration
protected override DependencyObject CloneSeries(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.DependencyObject | obj | object |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.DependencyObject |
Overrides
CreateSegment()
Creates an instance of series segment.
Declaration
protected override ChartSegment CreateSegment()
Returns
Type | Description |
---|---|
ChartSegment | Returns the instance of corresponding series segment. |
Overrides
Remarks
This customization is not supported for fast type series and technical indicators.
Examples
This sample shows how to call the CreateSegment() method to customize the line series segments.
public class LineSeriesExt : LineSeries
{
protected override ChartSegment CreateSegment()
{
return new LineSegmentExt();
}
}
public class LineSegmentExt : LineSegment
{
public override UIElement CreateVisual(Size size)
{
// Write your customization code here.
}
public override void Update(IChartTransformer transformer)
{
// Write your customization code here.
}
}
CreateSegments()
Creates the segments of StackingBarSeries.
Declaration
public override void CreateSegments()
Overrides
Explicit Interface Implementations
ISegmentSpacing.CalculateSegmentSpacing(Double, Double, Double)
Declaration
double ISegmentSpacing.CalculateSegmentSpacing(double spacing, double Right, double Left)
Parameters
Type | Name | Description |
---|---|---|
System.Double | spacing | |
System.Double | Right | |
System.Double | Left |
Returns
Type | Description |
---|---|
System.Double |