MAUI

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

    Show / Hide Table of Contents

    Class CircularDataLabelSettings

    The CircularDataLabelSettings class is used to customize the appearance of circular series data labels.

    Inheritance
    System.Object
    ChartDataLabelSettings
    CircularDataLabelSettings
    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 CircularDataLabelSettings : ChartDataLabelSettings
    Remarks

    To customize data labels, create an instance of the CircularDataLabelSettings class, and set it to the DataLabelSettings property of the circular series.

    ShowDataLabels

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

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

    Customization

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

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

    Constructors

    CircularDataLabelSettings()

    Initializes a new instance of the CircularDataLabelSettings.

    Declaration
    public CircularDataLabelSettings()

    Fields

    ConnectorTypeProperty

    Identifies the ConnectorType bindable property.

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

    Properties

    ConnectorType

    Gets or sets a value that can be used to specify the connector type.

    Declaration
    public ConnectorType ConnectorType { get; set; }
    Property Value
    Type Description
    ConnectorType

    It accepts ConnectorType values and its default value is Line.

    Examples
    • Xaml
    • C#
        <chart:SfCircularChart>
    
             <chart:PieSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               ShowDataLabels="True">
                   <chart:PieSeries.DataLabelSettings>
                       <chart:CircularDataLabelSettings ConnectorType="Curve" />
                   </chart:PieSeries.DataLabelSettings>
                 </chart:PieSeries>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
        ViewModel viewModel = new ViewModel();
    
        var dataLabelSettings = new CircularDataLabelSettings()
        {
            ConnectorType = ConnectorType.Curve
        };
        PieSeries series = new PieSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              ShowDataLabels = true,
              DataLabelSettings = dataLabelSettings,
        };
    
        chart.Series.Add(series);
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved