Class ChartEmptyPointSettings
Provides the options to customize the empty point of the chart.
Implements
Inherited Members
Namespace: Syncfusion.Blazor.Toolkit.Charts
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class ChartEmptyPointSettings : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker
Remarks
Empty points are data points whose Y values are null or NaN. This component controls how such points
are treated and displayed (mode, fill, and border). Property changes trigger fine-grained updates to avoid full re-rendering.
Constructors
ChartEmptyPointSettings()
Declaration
public ChartEmptyPointSettings()
Properties
Border
Gets or sets the border configuration of the empty point.
Declaration
public ChartEmptyPointBorder Border { get; set; }
Property Value
| Type | Description |
|---|---|
| ChartEmptyPointBorder | An instance of ChartEmptyPointBorder that defines the border properties for the empty point. |
Remarks
Use this property to specify border-related attributes such as color and width for the empty points, enhancing their appearance and distinction in the chart.
Examples
// This example demonstrates how to apply a custom border color to the empty points.
<SfChart>
<ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.Column">
<ChartEmptyPointSettings Mode="EmptyPointMode.Average">
<ChartEmptyPointBorder Width="2" Color="blue"></ChartEmptyPointBorder>
</ChartEmptyPointSettings>
</ChartSeries>
</SfChart>
Fill
Gets or sets the fill color of the empty point.
Declaration
public string Fill { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string representing the fill color of the empty point. |
Remarks
This property is used to define the color used to fill empty points in the chart.
Examples
// This example demonstrates how to handle empty points in a column chart by averaging them,
// and setting a custom fill color for the empty points.
<SfChart>
<ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.Column">
<ChartEmptyPointSettings Mode="EmptyPointMode.Average" Fill="red"></ChartEmptyPointSettings>
</ChartSeries>
</SfChart>
Mode
Gets or sets the mode for handling empty points in the SfChart series.
Declaration
public EmptyPointMode Mode { get; set; }
Property Value
| Type | Description |
|---|---|
| EmptyPointMode | An EmptyPointMode enumeration value that indicates how empty points are treated in the chart. Options include:
|
Remarks
This property determines how the chart visually represents data points that are missing or explicitly set to be empty. Use the Mode property to control how empty points are rendered. Data points with NaN or null values are treated as empty points.
Examples
// The following example demonstrates how to set the empty point mode to Average:
<SfChart>
<ChartSeries DataSource="@WeatherReports" XName="X" YName="Y" Type="ChartSeriesType.Column">
<ChartEmptyPointSettings Mode="EmptyPointMode.Average" />
</ChartSeries>
</SfChart>
@code {
public class ChartData
{
public double X { get; set; }
public double? Y { get; set; }
}
public List<ChartData> WeatherReports = new List<ChartData>
{
new ChartData { X = 10, Y = 21 },
new ChartData { X = 20, Y = null },
new ChartData { X = 30, Y = 36 },
new ChartData { X = 40, Y = 38 }
};
}