A data point is considered "empty" if one or more of its mandatory values are set to DBNull.Value. The following example creates a line series and adds three values:
C# |
Copy Code
|
---|---|
NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line); line.Values.Add(10); line.Values.Add(DBNull.Value); line.Values.Add(20); |
Visual Basic |
Copy Code
|
---|---|
Dim line As NLineSeries = 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 be considered empty since the Y value of the line series is required, but is set to DBNull.Value.
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. This is because the line series is not switched in XY scatter mode and the X values are not mandatory.
C# |
Copy Code
|
---|---|
NLineSeries line2 = (NLineSeries)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); |
Visual Basic |
Copy Code
|
---|---|
Dim line2 As NLineSeries = 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 line2 series to true, the second data point will become an empty data point, because the X value will become mandatory.
C# |
Copy Code
|
---|---|
line2.UseXValues = true;
|
Visual Basic |
Copy Code
|
---|---|
line2.UseXValues = True
|