interpolatedValue = (precedingValue / 2) + (subsequentValue / 2)
Charts are often required to display sets of data which contain null values. Since null values in a data source can have different meanings, the Chart control provides a variety of ways to plot null values in a set.
A common question that is asked when handling null values is: Where on the chart should values be placed when they are null?
For most chart types, the Chart control provides a NullHandling property. In the Properties window of the Designer view, the NullHandling property is available under the property that corresponds to the chart type. For example, in the Properties window of the Column chart, the NullHandling property is available under the ColumnChart property.
The following is a list of the NullHandling values. Each value treats null values differently.
NullHandling.Zero — Plots null values at 0.0 on the y-axis
NullHandling.DontPlot — Does not connect segments; it skips over them and does not connect the adjacent point.
NullHandling.InterpolateSimple — Uses simple (linear) interpolation to plot a point between the null value’s preceding and subsequent formulas. The following is the formula used for this:
interpolatedValue = (precedingValue / 2) + (subsequentValue / 2)
NullHandling.InterpolateCustom — Performs custom interpolation logic at the application level to populate the null values by handling the UltraChart.InterpolateValues event. In the above example, this event handler populates null values with the value 120\.
The table below is an example of an Area chart’s data set:
The area chart images below illustrate how the data is plotted using the four different types of null handling.