Class ChartSegment
Defines the collection of regions that helps to differentiate a line Type series.
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChartSegment : ChartSubComponent, ISubcomponentTracker
Constructors
ChartSegment()
Declaration
public ChartSegment()
Properties
Color
Gets or sets the color of the segment series.
Declaration
public string Color { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the color of the segment, used to visually distinguish it from other segments in the chart. |
Remarks
By adjusting this property, you can enhance the visual presentation of the chart by applying specific color codes to different segments.
Examples
// This example demonstrates how to render a MultiColoredArea chart with custom segment color.
<SfChart>
<ChartSeriesCollection>
<ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.MultiColoredArea">
<ChartSegments>
<ChartSegment Value="30" Color="blue" DashArray="4,3" />
</ChartSegments>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
DashArray
Gets or sets the dash array of the segment series.
Declaration
public string DashArray { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that defines the pattern of dashes and gaps used to outline the segment in the series. |
Remarks
This property provides control over the line style of the chart segment, enabling customization of patterns such as dotted or dashed lines for stylistic variations.
Examples
// This example demonstrates how to render a MultiColoredArea chart with custom segment dash pattern.
<SfChart>
<ChartSeriesCollection>
<ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.MultiColoredArea">
<ChartSegments>
<ChartSegment Value="30" Color="blue" DashArray="4,3" />
</ChartSegments>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
Value
Gets or sets the value of the segment series.
Declaration
public object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An object representing the value associated with the segment within the chart series. |
Remarks
This property allows you to assign or retrieve data values specific to this segment, which can affect the visual representation and data interpretation of the series.
Examples
// This example demonstrates how to render a MultiColoredArea chart with custom segment value pattern.
<SfChart>
<ChartSeriesCollection>
<ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.MultiColoredArea">
<ChartSegments>
<ChartSegment Value="30" Color="blue" />
</ChartSegments>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>