[]
        
(Showing Draft Content)

Display N/A Values

GcExcel.NET provides support to display #N/A cells as empty cells in charts. The DisplayNaAsBlank property of IChart interface, when set to true, considers the cells containing #N/A values as empty cells. When DisplayNaAsBlank property is set to true, the display of empty cells, when plotted on a chart depends on the value of DisplayBlanksAs property. The property accepts values from DisplayBlankAs enumeration and can have following three values:

  • Interpolated- #N/A values are shown as 'interpolated' in the chart

  • NotPlotted- #N/A values are shown as 'gaps' in the chart

  • Zero - #N/A values are shown as 'zero' in the chart

The below screenshot depicts a chart created from data containing #N/A cells which is displayed as zero because value of DisplayBlankAs is set to 'Zero'.


Following code demonstrates a line chart showing values plotted with DisplayNaAsBlank set to true.

// Set show blank as zero.
shape.Chart.DisplayBlanksAs = DisplayBlanksAs.Zero;
        
// Set show #N/A as empty cell.
shape.Chart.DisplayNaAsBlank = true;
shape.Chart.ChartTitle.Text = "DisplayNaAsBlank:True";

When DisplayNaAsBlank property is set to false, chart plots the #N/A values depending on the chart type.