MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class FunnelDataLabelSettings

    Show / Hide Table of Contents

    Class FunnelDataLabelSettings

    The FunnelDataLabelSettings class is used to customize the appearance of funnel chart data labels.

    Inheritance
    System.Object
    ChartDataLabelSettings
    FunnelDataLabelSettings
    Inherited Members
    ChartDataLabelSettings.UseSeriesPaletteProperty
    ChartDataLabelSettings.LabelStyleProperty
    ChartDataLabelSettings.LabelPlacementProperty
    ChartDataLabelSettings.OnBindingContextChanged()
    ChartDataLabelSettings.UseSeriesPalette
    ChartDataLabelSettings.LabelStyle
    ChartDataLabelSettings.LabelPlacement
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class FunnelDataLabelSettings : ChartDataLabelSettings, IPyramidDataLabelSettings
    Remarks

    To customize data labels, create an instance of the FunnelDataLabelSettings class, and set it to the DataLabelSettings property of the funnel chart.

    ShowDataLabels

    Data labels can be added to a chart series by enabling the ShowDataLabels option.

    • Xaml
    • C#
       <chart:SfFunnelChart ItemsSource ="{Binding Data}"
                             XBindingPath="XValue"
                             YBindingPath="YValue"
                             ShowDataLabels="True"/>
    SfFunnelChart chart = new SfFunnelChart();
    ViewModel viewModel = new ViewModel();
    chart.ItemsSource = viewModel.Data;
    chart.XBindingPath = "XValue";
    chart.YBindingPath = "YValue";
    chart.ShowDataLabels= true;
    
    this.Content = chart;

    Customization

    To change the appearance of data labels, it offers LabelStyle options.

    • Xaml
    • C#
       <chart:SfFunnelChart ItemsSource ="{Binding Data}"
                             XBindingPath="XValue"
                             YBindingPath="YValue"
                             ShowDataLabels="True">
           <chart:SfFunnelChart.DataLabelSettings>
               <chart:FunnelDataLabelSettings>
                   <chart:FunnelDataLabelSettings.LabelStyle>
                       <chart:ChartDataLabelStyle Background = "Red" FontSize="14" TextColor="Black" />
                   </chart:FunnelDataLabelSettings.LabelStyle>
               </chart:FunnelDataLabelSettings>
           </chart:SfFunnelChart.DataLabelSettings>
       </chart:SfFunnelChart>
    SfFunnelChart chart = new SfFunnelChart();
    ViewModel viewModel = new ViewModel();
    chart.ItemsSource = viewModel.Data;
    chart.XBindingPath = "XValue";
    chart.YBindingPath = "YValue";
    chart.ShowDataLabels= true;
    
    var labelStyle = new ChartDataLabelStyle()
    {
        Background = new SolidColorBrush(Colors.Red),
        TextColor = Colors.Black,
        FontSize = 14,
    };
    
    chart.DataLabelSettings = new FunnelDataLabelSettings()
    {
        LabelStyle = labelStyle,
    };
    
    this.Content = chart;

    Constructors

    FunnelDataLabelSettings()

    Initializes a new instance of the FunnelDataLabelSettings.

    Declaration
    public FunnelDataLabelSettings()

    Fields

    ContextProperty

    Identifies the Context bindable property.

    Declaration
    public static readonly BindableProperty ContextProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    Properties

    Context

    Gets or sets an option that determines the content to be displayed in the data labels.

    Declaration
    public FunnelDataLabelContext Context { get; set; }
    Property Value
    Type Description
    FunnelDataLabelContext

    Its default value is YValue.

    Examples
    • Xaml
    • C#
       <chart:SfFunnelChart ItemsSource ="{Binding Data}"
                             XBindingPath="XValue"
                             YBindingPath="YValue"
                             ShowDataLabels="True">
           <chart:SfFunnelChart.DataLabelSettings>
               <chart:FunnelDataLabelSettings Context="XValue"/>
           </chart:SfFunnelChart.DataLabelSettings>
       </chart:SfFunnelChart>
    SfFunnelChart chart = new SfFunnelChart();
    ViewModel viewModel = new ViewModel();
    chart.ItemsSource = viewModel.Data;
    chart.XBindingPath = "XValue";
    chart.YBindingPath = "YValue";
    chart.ShowDataLabels= true;
    
    chart.DataLabelSettings = new FunnelDataLabelSettings()
    {
        Context = FunnelDataLabelContext.XValue
    };
    
    this.Content = chart;
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved