Class ChartSegment
Represents a segment of a chart, providing properties and methods to customize its appearance within the chart.
Inheritance
Implements
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public abstract class ChartSegment : Object, INotifyPropertyChanged
Constructors
ChartSegment()
Initializes a new instance of the ChartSegment class.
Declaration
public ChartSegment()
Properties
Fill
Gets or sets a brush value to customize the appearance of the segment.
Declaration
public Brush Fill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts a Microsoft.Maui.Controls.Brush value and its default value is null. |
Index
Gets the index of the specified chart segment within the collection.
Declaration
public int Index { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The index of the chart segment, or -1 if not found. |
Item
Gets the segment data associated with the business model.
Declaration
public object Item { get; }
Property Value
Type |
---|
System.Object |
Opacity
Gets or sets a value to change the opacity of the segment.
Declaration
public float Opacity { get; set; }
Property Value
Type | Description |
---|---|
System.Single | It accepts a float value ranging from 0 to 1 and its default value is 1. |
Series
Gets the series associated with the segment.
Declaration
public ChartSeries Series { get; }
Property Value
Type |
---|
ChartSeries |
Stroke
Gets or sets a brush value to customize the border appearance of the segment.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts a Microsoft.Maui.Controls.Brush value and its default value is null. |
StrokeDashArray
Gets or sets the stroke dash array to customize the appearance of the stroke.
Declaration
public DoubleCollection StrokeDashArray { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DoubleCollection | It accepts the Microsoft.Maui.Controls.DoubleCollection value and the default value is null. |
StrokeWidth
Gets or sets a value to change the thickness of the segment's border.
Declaration
public double StrokeWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts a double value and its default value is 1. |
Remarks
Value must be 1 or greater.
Methods
Draw(ICanvas)
Draws a segment for the specified chart series or charts.
Declaration
protected virtual void Draw(ICanvas canvas)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.ICanvas | canvas |
OnLayout()
Calculates the required values for rendering the chart segment.
Declaration
protected virtual void OnLayout()