Class EmptyPointSettings
Used to customize the empty points which are NaN data points.
Inheritance
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class EmptyPointSettings : Element
Remarks
By customizing these empty points, the positions of the data points are highlighted, thereby improving data visualization.
EmptyPointSettings class provides properties to customize these empty points by modifying attributes such as Fill, Stroke, and StrokeWidth.
To customize empty points, create an instance of EmptyPointSettings, configure it as needed, and then add it to the series.
EmptyPointSettings is not supported for all area-related series, as well as for FastChart and ErrorBarSeries.
# [MainPage.xaml](#tab/tabid-1)<chart:SfCartesianChart>
<chart:SfCartesianChart.BindingContext>
<local:ViewModel/>
</chart:SfCartesianChart.BindingContext>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.YAxes>
<chart:SfCartesianChart.Series>
<chart:LineSeries ItemsSource = "{Binding Data}" XBindingPath="XValue" YBindingPath="YValue" EmptyPointMode="Zero"/>
<chart:LineSeries.EmptyPointSettings>
<chart:EmptyPointSettings Fill="Orange" Stroke="Red" StrokeWidth="3"/>
</chart:LineSeries.EmptyPointSettings>
</chart:SfCartesianChart.Series>
</chart:SfCartesianChart>
SfCartesianChart chart = new SfCartesianChart();
ViewModel viewModel = new ViewModel();
chart.BindingContext = viewModel;
NumericalAxis xaxis = new NumericalAxis();
chart.XAxes.Add(xaxis);
NumericalAxis yAxis = new NumericalAxis();
chart.YAxes.Add(yAxis);
LineSeries series = new LineSeries();
series.ItemsSource = viewModel.Data;
series.XBindingPath = "XValue";
series.YBindingPath = "YValue";
series.EmptyPointMode = EmptyPointMode.Zero;
series.EmptyPointSettings = new EmptyPointSettings();
series.EmptyPointSettings.Fill = Colors.Orange;
series.EmptyPointSettings.Stroke = Colors.Red;
series.EmptyPointSettings.StrokeWidth = 3;
chart.Series.Add(series);
Constructors
EmptyPointSettings()
Initializes a new instance of the EmptyPointSettings
Declaration
public EmptyPointSettings()
Fields
FillProperty
Identifies the Fill bindable property.
Declaration
public static readonly BindableProperty FillProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the Fill bindable property determines the fill color of the empty point.
StrokeProperty
Identifies the Stroke bindable property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the Stroke bindable property determines the stroke color of the empty point.
StrokeWidthProperty
Identifies the StrokeWidth bindable property.
Declaration
public static readonly BindableProperty StrokeWidthProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the StrokeWidth bindable property determines the stroke width of the empty point.
Properties
Fill
Gets or sets the value to fill empty point.
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 FF4F4F. |
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EmptyPointMode="Zero">
<chart:LineSeries.EmptyPointSettings>
<chart:EmptyPointSettings Fill="Orange"/>
</chart:LineSeries.EmptyPointSettings>
</chart:LineSeries>
</chart:SfCartesianChart>
Stroke
Gets or sets the value for empty point stroke.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts Microsoft.Maui.Controls.Brush values and its default value is |
Remarks
EmptyPointSettings of stroke is not supported for Waterfall series.
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EmptyPointMode="Average">
<chart:ColumnSeries.EmptyPointSettings>
<chart:EmptyPointSettings Stroke="Red" StrokeWidth="3"/>
</chart:ColumnSeries.EmptyPointSettings>
</chart:ColumnSeries>
</chart:SfCartesianChart>
StrokeWidth
Gets or sets the value for empty point stroke width.
Declaration
public double StrokeWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts |
Remarks
The value needs to be greater than zero.
EmptyPointSettings of StrokeWidth is not supported for Waterfall series.
Examples
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
EmptyPointMode="Zero">
<chart:LineSeries.EmptyPointSettings>
<chart:EmptyPointSettings StrokeWidth="3"/>
</chart:LineSeries.EmptyPointSettings>
</chart:LineSeries>
</chart:SfCartesianChart>