[]
While plotting data on charts, you may have to deal with visualization of blank or empty cells on them. Depending on the requirement, you may want to plot empty values as gaps, zero or connected lines on the chart. This feature is helpful in plotting the missing data in a chart and hence facilitates users in quickly identifying and correcting any issues with the data.
Similar to Excel, GcExcel provides support for displaying empty cells and null values in charts using DisplayBlanksAs property. The property accepts values from DisplayBlankAs enumeration and can have following three values:
Interpolated- Blank values are shown as 'interpolated' in the chart
NotPlotted- Blank values are shown as 'gaps' in the chart
Zero - Blank values are shown as 'zero' in the chart
This property is especially useful when DisplayNaAsBlank property is set to true. For more information, see Display #N/A Values.
Below images demonstrate how a daily rainfall chart is plotted with value against Day 4 as blank when DisplayBlankAs property is set to NotPlotted, Zero or Interpolated.
DisplayBlankAs = NotPlotted | DisplayBlankAs = Zero | DisplayBlankAs = Interpolated |
---|---|---|
Below code shows how to set DisplayBlankAs property to plot blank values as zero.
// Set show blank as zero.
shape.Chart.DisplayBlanksAs = DisplayBlanksAs.Zero;