Class ConnectorLineStyle
The ConnectorLineStyle class is used to customize the appearance of the data label connector line when data labels are placed outside.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class ConnectorLineStyle : ChartLineStyle, IThemeElement
Remarks
To customize connector lines, create an instance of the ConnectorLineStyle class, and set it to the ConnectorLineSettings property of the CircularDataLabelSettings.
# [Xaml](#tab/tabid-1) <chart:SfCircularChart>
<chart:PieSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings LabelPosition="Outside" >
<chart:CircularDataLabelSettings.ConnectorLineSettings>
<chart:ConnectorLineStyle Stroke="Red" StrokeWidth="2" />
</chart:CircularDataLabelSettings.ConnectorLineSettings>
</chart:CircularDataLabelSettings>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>
# [C#](#tab/tabid-2)
SfCircularChart chart = new SfCircularChart();
ViewModel viewModel = new ViewModel();
PieSeries series = new PieSeries()
{
ItemsSource = viewModel.Data,
XBindingPath = "XValue",
YBindingPath = "YValue",
ShowDataLabels = true,
};
var connectorLineStyle = new ConnectorLineStyle
{
Stroke = new SolidColorBrush(Colors.Red),
StrokeWidth = 2
};
series.DataLabelSettings = new CircularDataLabelSettings()
{
LabelPosition="Outside"
ConnectorLineSettings = connectorLineStyle
};
chart.Series.Add(series);</code></pre>
Constructors
ConnectorLineStyle()
Declaration
public ConnectorLineStyle()
Fields
ConnectorTypeProperty
Identifies the ConnectorType bindable property.
Declaration
public static readonly BindableProperty ConnectorTypeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
ConnectorType
Gets or sets a value that specifies 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
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="Product"
YBindingPath="SalesRate"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings LabelPlacement="Outer" ConnectorType="Curve"/>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>