WinUI

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

    Show / Hide Table of Contents

    Class SfPyramidChart

    Renders the pyramid chart.

    Inheritance
    System.Object
    ChartBase
    SfPyramidChart
    Implements
    System.IDisposable
    Inherited Members
    ChartBase.VisibleSeriesProperty
    ChartBase.HeaderProperty
    ChartBase.HorizontalHeaderAlignmentProperty
    ChartBase.VerticalHeaderAlignmentProperty
    ChartBase.TooltipBehaviorProperty
    ChartBase.LegendProperty
    ChartBase.SuspendSeriesNotification()
    ChartBase.ResumeSeriesNotification()
    ChartBase.Dispose()
    ChartBase.OnApplyTemplate()
    ChartBase.MeasureOverride(Size)
    ChartBase.OnLostFocus(RoutedEventArgs)
    ChartBase.OnGotFocus(RoutedEventArgs)
    ChartBase.OnPointerCaptureLost(PointerRoutedEventArgs)
    ChartBase.OnTapped(TappedRoutedEventArgs)
    ChartBase.OnRightTapped(RightTappedRoutedEventArgs)
    ChartBase.OnPointerWheelChanged(PointerRoutedEventArgs)
    ChartBase.OnPointerExited(PointerRoutedEventArgs)
    ChartBase.OnPointerEntered(PointerRoutedEventArgs)
    ChartBase.OnPointerCanceled(PointerRoutedEventArgs)
    ChartBase.OnKeyUp(KeyRoutedEventArgs)
    ChartBase.OnKeyDown(KeyRoutedEventArgs)
    ChartBase.OnHolding(HoldingRoutedEventArgs)
    ChartBase.OnManipulationStarting(ManipulationStartingRoutedEventArgs)
    ChartBase.OnManipulationStarted(ManipulationStartedRoutedEventArgs)
    ChartBase.OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)
    ChartBase.OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)
    ChartBase.OnManipulationDelta(ManipulationDeltaRoutedEventArgs)
    ChartBase.OnPointerPressed(PointerRoutedEventArgs)
    ChartBase.OnPointerMoved(PointerRoutedEventArgs)
    ChartBase.OnPointerReleased(PointerRoutedEventArgs)
    ChartBase.OnDoubleTapped(DoubleTappedRoutedEventArgs)
    ChartBase.TooltipBehavior
    ChartBase.Header
    ChartBase.HorizontalHeaderAlignment
    ChartBase.VerticalHeaderAlignment
    ChartBase.Legend
    ChartBase.SeriesBoundsChanged
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public class SfPyramidChart : ChartBase, IDisposable
    Remarks

    Pyramid chart control is used to visualize the proportions of a total in hierarchies.

    SfPyramidChart class allows to customize the chart elements such as legend, data label, and tooltip features.

    Legend

    The Legend contains list of data points in chart series. The information provided in each legend item helps to identify the corresponding data point in chart series. The Series property value will be displayed in the associated legend item.

    To render a legend, create an instance of ChartLegend, and assign it to the Legend property.

    • MainPage.xaml
    • MainPage.xaml.cs
    • ViewModel.cs
     
    <chart:SfPyramidChart ItemsSource = "{Binding Data}" XBindingPath="XValue" YBindingPath="YValue">
    
           <chart:SfPyramidChart.BindingContext>
               <local:ViewModel/>
           </chart:SfPyramidChart.BindingContext>
           <chart:SfPyramidChart.Legend>
               <chart:ChartLegend/>
           </chart:SfPyramidChart.Legend>
    
    </chart:SfPyramidChart>
    ViewModel viewModel = new ViewModel();
    
    SfPyramidChart chart = new SfPyramidChart()
    {
        ItemsSource = viewmodel.Data,
        XBindingPath = "XValue",
        YBindingPath = "YValue"
    };
    
    chart.BindingContext = viewModel;
    chart.Legend = new ChartLegend();
    public ObservableCollection<Model> Data { get; set; }
    
    public ViewModel()
    {
       Data = new ObservableCollection<Model>();
       Data.Add(new Model() { XValue = "A", YValue = 100 });
       Data.Add(new Model() { XValue = "B", YValue = 150 });
       Data.Add(new Model() { XValue = "C", YValue = 110 });
       Data.Add(new Model() { XValue = "D", YValue = 230 });
    }

    Tooltip

    Tooltip displays information while tapping or mouse hover on the segment. To display the tooltip on the chart, you need to set the ShowTooltip property as true in ChartSeriesBase.

    To customize the appearance of the tooltip elements like Background, TextColor and Font, create an instance of ChartTooltipBehavior class, modify the values, and assign it to the chart’s TooltipBehavior property.

    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfPyramidChart ShowTooltip = "True" ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue">
    
            <chart:SfPyramidChart.BindingContext>
                <local:ViewModel/>
            </chart:SfPyramidChart.BindingContext>
    
            <chart:SfPyramidChart.TooltipBehavior>
                <chart:ChartTooltipBehavior/>
            </chart:SfPyramidChart.TooltipBehavior>
    
    </chart:SfPyramidChart>
    ViewModel viewModel = new ViewModel();
    
    SfPyramidChart chart = new SfPyramidChart()
    {
       ItemsSource = viewmodel.Data,
       XBindingPath = "XValue",
       YBindingPath = "YValue",
       ShowTooltip = true
    };
    
    chart.BindingContext = viewModel;
    
    chart.TooltipBehavior = new ChartTooltipBehavior();

    Data Label

    Data labels are used to display values related to a chart segment. To render the data labels, you need to enable the ShowDataLabels property as true in SfPyramidChart class.

    To customize the chart data labels alignment, placement and label styles, need to create an instance of PyramidDataLabelSettings and set to the DataLabelSettings property.

    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfPyramidChart ShowDataLabels = "True" ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue">
    
           <chart:SfPyramidChart.BindingContext>
               <local:ViewModel/>
           </chart:SfPyramidChart.BindingContext>
    
    </chart:SfPyramidChart>
    ViewModel viewModel = new ViewModel();
    
    SfPyramidChart chart = new SfPyramidChart()
    {
        ItemsSource = viewmodel.Data,
        XBindingPath = "XValue",
        YBindingPath = "YValue",
        ShowDataLabels = true
    };
    
    chart.BindingContext = viewModel;

    Constructors

    SfPyramidChart()

    Declaration
    public SfPyramidChart()

    Fields

    DataLabelSettingsProperty

    Identifies the DataLabelSettings dependency property.

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

    The identifier for DataLabelSettings dependency property.

    ExplodeIndexProperty

    Identifies the ExplodeIndex dependency property.

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

    The identifier for ExplodeIndex dependency property.

    ExplodeOffsetProperty

    Identifies the ExplodeOffset dependency property.

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

    The identifier for ExplodeOffset dependency property.

    ExplodeOnTapProperty

    Identifies the ExplodeOnTap dependency property.

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

    The identifier for ExplodeOnTap dependency property.

    GapRatioProperty

    Identifies the GapRatio dependency property.

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

    The identifier for GapRatio 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.

    ModeProperty

    Identifies the Mode dependency property.

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

    The identifier for Mode dependency property.

    PaletteBrushesProperty

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

    SelectionBehaviorProperty

    The DependencyProperty for SelectionBehavior property. .

    Declaration
    public static readonly DependencyProperty SelectionBehaviorProperty
    Field Value
    Type Description
    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 ShowDataLabels dependency property and its default value is false.

    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.

    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.

    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.

    YBindingPathProperty

    Identifies the YBindingPath dependency property.

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

    The identifier for YBindingPath dependency property.

    Properties

    DataLabelSettings

    Declaration
    public PyramidDataLabelSettings DataLabelSettings { get; set; }
    Property Value
    Type Description
    PyramidDataLabelSettings

    ExplodeIndex

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

    ExplodeOffset

    Declaration
    public double ExplodeOffset { get; set; }
    Property Value
    Type Description
    System.Double

    ExplodeOnTap

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

    GapRatio

    Declaration
    public double GapRatio { get; set; }
    Property Value
    Type Description
    System.Double

    ItemsSource

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

    Mode

    Declaration
    public ChartPyramidMode Mode { get; set; }
    Property Value
    Type Description
    ChartPyramidMode

    PaletteBrushes

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

    SelectionBehavior

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

    ShowDataLabels

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

    ShowTooltip

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

    TooltipTemplate

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

    XBindingPath

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

    YBindingPath

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

    Implements

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