Xceed Chart for WinForms v4.4 Documentation
Empty Data Points Overview

Welcome to Xceed Chart for WinForms v4.4 > User Guide > Data Manipulation > Empty Data Points Overview

What are Empty Data Points?

As discussed in the Concepts and Terminology topic, a data point is a composite object assembled at runtime and refers to all the values that a specific series needs in order to be properly displayed. In this aspect, a data point is considered "empty" if one or more of the values it requires are set to null or DBNull.Value. It is important to understand that a data point is considered empty if a value that is used is null, for example, if we create a line series with the following code:

VB.NET  

Dim line As LineSeries = CType(Chart.Series.Add(SeriesType.Line), LineSeries)
line.Values.Add(10)
line.Values.Add(DBNull.Value)
line.Values.Add(20)
C#  
LineSeries line = (LineSeries)Chart.Series.Add(SeriesType.Line);
line.Values.Add(10);
line.Values.Add(DBNull.Value);
line.Values.Add(20);

The second data point of the line will always be considered empty because the Y value of the line series is always required. 

In the following example, the second data point is not considered empty even though the X value of the data point is set to DBNull.Value, since the line series is not switched to XYScatter mode and thus requires only Y values in order to be correctly displayed. 

VB.NET  

Dim line2 As LineSeries = CType(Chart.Series.Add(SeriesType.Line), LineSeries)

line2.Values.Add(10)
line2.Values.Add(15)
line2.Values.Add(20)
line2.XValues.Add(10)
line2.XValues.Add(DBNull.Value)
line2.XValues.Add(20)
C#  
LineSeries line2 = (LineSeries)Chart.Series.Add(SeriesType.Line);

line2.Values.Add(10);
line2.Values.Add(15);
line2.Values.Add(20);
line2.XValues.Add(10);
line2.XValues.Add(DBNull.Value);
line2.XValues.Add(20);

If later in your code you set the UseXValues property of the second line series to true, the second data point will become an empty data point since this time the X values are used and the second data point cannot be properly displayed:

VB.NET  
line2.UseXValue = True

C#  
line2.UseXValue = true;

How Does Xceed Chart for WinForms Handle Empty Data Points?

The handling of empty data points is a complex matter, but in general it can be divided into two parts:

  • Analysis at data level.
  • Analysis at presentation level.

Analysis at data level determines the strategy that the component uses to assign a value to the empty data point so that it can be rendered. For more information, please refer to the Handling Empty Data Points at Data Analysis Level  topic. 

Analysis at presentation level defines the way in which empty data points are displayed. For more information, please refer to the Handling Empty Data Points at Presentation Level topic.

Related Examples

Windows Forms: Series\Data Manipulation\EmptyData Points\EmptyData Points

See Also

DataSeries | EmptyDataPoints  | EmptyDataPointsAppearance