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.RotationProperty
    ChartDataLabelSettings.BackgroundProperty
    ChartDataLabelSettings.BorderThicknessProperty
    ChartDataLabelSettings.BorderBrushProperty
    ChartDataLabelSettings.MarginProperty
    ChartDataLabelSettings.FontStyleProperty
    ChartDataLabelSettings.FontSizeProperty
    ChartDataLabelSettings.ForegroundProperty
    ChartDataLabelSettings.UseSeriesPaletteProperty
    ChartDataLabelSettings.HighlightOnSelectionProperty
    ChartDataLabelSettings.HorizontalAlignmentProperty
    ChartDataLabelSettings.VerticalAlignmentProperty
    ChartDataLabelSettings.ConnectorHeightProperty
    ChartDataLabelSettings.ConnectorRotationProperty
    ChartDataLabelSettings.ConnectorLineStyleProperty
    ChartDataLabelSettings.ContentTemplateProperty
    ChartDataLabelSettings.FontFamilyProperty
    ChartDataLabelSettings.ContextProperty
    ChartDataLabelSettings.FormatProperty
    ChartDataLabelSettings.Rotation
    ChartDataLabelSettings.Background
    ChartDataLabelSettings.BorderThickness
    ChartDataLabelSettings.BorderBrush
    ChartDataLabelSettings.Margin
    ChartDataLabelSettings.FontStyle
    ChartDataLabelSettings.FontSize
    ChartDataLabelSettings.Foreground
    ChartDataLabelSettings.UseSeriesPalette
    ChartDataLabelSettings.HighlightOnSelection
    ChartDataLabelSettings.HorizontalAlignment
    ChartDataLabelSettings.VerticalAlignment
    ChartDataLabelSettings.ConnectorHeight
    ChartDataLabelSettings.ConnectorRotation
    ChartDataLabelSettings.ConnectorLineStyle
    ChartDataLabelSettings.ShowConnectorLine
    ChartDataLabelSettings.ContentTemplate
    ChartDataLabelSettings.FontFamily
    ChartDataLabelSettings.Series
    ChartDataLabelSettings.Context
    ChartDataLabelSettings.Format
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public sealed class FunnelDataLabelSettings : ChartDataLabelSettings
    Remarks

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

    ShowDataLabels

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

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

    ContentTemplate

    The appearance of the data label can be customized using the ContentTemplate property of FunnelDataLabelSettings.

    • Xaml
       <chart:SfFunnelChart ItemsSource ="{Binding Data}"
                            XBindingPath="XValue"
                            YBindingPath="YValue"
                            ShowDataLabels="True">
    
               <chart:SfFunnelChart.DataLabelSettings>
                   <chart:FunnelDataLabelSettings>
                       <chart:FunnelDataLabelSettings.ContentTemplate>
                           <DataTemplate>
                              <StackPanel Margin = "10" Orientation="Vertical">
                                   <Ellipse Height = "15" Width="15" Fill="Cyan" 
                                            Stroke="#4a4a4a" StrokeThickness="2"/>
                                   <TextBlock HorizontalAlignment = "Center" FontSize="12"
                                              Foreground="Black" FontWeight="SemiBold"
                                              Text="{Binding}"/>
                              </StackPanel>
                           </DataTemplate>
                       </chart:FunnelDataLabelSettings.ContentTemplate>
                   </chart:FunnelDataLabelSettings>
               </chart:SfFunnelChart.DataLabelSettings>
       </chart:SfFunnelChart>

    Context

    To customize the content of data labels, it offers Context property.

    • Xaml
    • C#
       <chart:SfFunnelChart ItemsSource ="{Binding Data}"
                            XBindingPath="XValue"
                            YBindingPath="YValue"
                            ShowDataLabels="True">
             <chart:SfFunnelChart.DataLabelSettings>
                 <chart:FunnelDataLabelSettings Context="Percentage" />
             </chart:SfFunnelChart.DataLabelSettings>
       </chart:SfFunnelChart>
        ViewModel viewModel = new ViewModel();
    
        SfFunnelChart chart = new SfFunnelChart()
        {
           ItemsSource = viewModel.Data,
           XBindingPath = "XValue",
           YBindingPath = "YValue",
           ShowDataLabels = true
        };
    
        chart.DataLabelSettings = new FunnelDataLabelSettings()
        {
            Context = LabelContext.Percentage,
        };

    Customization

    To change the appearance of data labels, it offers BorderBrush, BorderThickness, Margin, Foreground, Background, FontStyle, FontSize, and FontFamily options.

    • Xaml
    • C#
       <chart:SfFunnelChart ItemsSource ="{Binding Data}"
                            XBindingPath="XValue"
                            YBindingPath="YValue"
                            ShowDataLabels="True">
             <chart:SfFunnelChart.DataLabelSettings>
                 <chart:FunnelDataLabelSettings Foreground="White" FontSize="11" 
                                                FontFamily="Calibri" BorderBrush="Black" BorderThickness="1" Margin="1" 
                                                FontStyle="Italic" Background="#1E88E5" />
             </chart:SfFunnelChart.DataLabelSettings>
       </chart:SfFunnelChart>
        ViewModel viewModel = new ViewModel();
    
        SfFunnelChart chart = new SfFunnelChart()
        {
           ItemsSource = viewModel.Data,
           XBindingPath = "XValue",
           YBindingPath = "YValue",
           ShowDataLabels = true,
        };
    
        chart.DataLabelSettings = new FunnelDataLabelSettings()
        {
            Foreground = new SolidColorBrush(Colors.White),
            BorderBrush = new SolidColorBrush(Colors.Black),
            Background = new SolidColorBrush(Color.FromArgb(255, 30, 136, 229)),
            BorderThickness = new Thickness(1),
            Margin = new Thickness(1),
            FontStyle = FontStyle.Italic,
            FontFamily = new FontFamily("Calibri"),
            FontSize = 11,
        };

    Constructors

    FunnelDataLabelSettings()

    Initializes a new instance of the FunnelDataLabelSettings class.

    Declaration
    public FunnelDataLabelSettings()
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved