menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartEmptyPointSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartEmptyPointSettings

    Provides the options to customize the empty point of the chart.

    Inheritance
    System.Object
    ChartSubComponent
    ChartEmptyPointSettings
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartEmptyPointSettings : ChartSubComponent, ISubcomponentTracker

    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>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.Column">
                <ChartEmptyPointSettings Mode="EmptyPointMode.Average">
                    <ChartEmptyPointBorder Width="2" Color="blue"></ChartEmptyPointBorder>
                </ChartEmptyPointSettings>
            </ChartSeries>
        </ChartSeriesCollection>
    </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>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue" Type="ChartSeriesType.Column">
                <ChartEmptyPointSettings Mode="EmptyPointMode.Average" Fill="red"></ChartEmptyPointSettings>
            </ChartSeries>
        </ChartSeriesCollection>
    </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:

    • Gap: Leaves a gap for empty points.
    • Zero: Renders empty points as zero.
    • Average: Uses the average of adjacent points for empty points.
    • Drop: Drops empty points from the chart. The default value is Gap.
    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 <c>Average</c>:
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@WeatherReports" XName="X" YName="Y" Type="ChartSeriesType.Column">
                <ChartEmptyPointSettings Mode="EmptyPointMode.Average" />
            </ChartSeries>
        </ChartSeriesCollection>
    </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 }
    };
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved