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.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.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 = ChartDataLabelPosition.Outside
ConnectorLineSettings = connectorLineStyle
};
chart.Series.Add(series);</code></pre>
Constructors
ConnectorLineStyle()
Initializes a new instance of the ConnectorLineStyle class.
Declaration
public ConnectorLineStyle()
Fields
ConnectorTypeProperty
Identifies the ConnectorType bindable property.
Declaration
public static readonly BindableProperty ConnectorTypeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the ConnectorType bindable property determines the type of connector line used in the circular chart.
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="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings LabelPosition="Outside" >
<chart:CircularDataLabelSettings.ConnectorLineSettings>
<chart:ConnectorLineStyle ConnectorType="Curve"/>
</chart:CircularDataLabelSettings.ConnectorLineSettings>
</chart:CircularDataLabelSettings>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>