Question

Is it possible to display "0" in FusionCharts Heatmap instead of blanks (missing values)? For example now it looks like this:

FusionCharts Heatmap

I'd like to display 0 instead of missing/blank values.

Was it helpful?

Solution

Thanks to overwhelming support by SO community, I went back to my original research of this question.

Turned out the solution was obvious and right under my own nose. Originally the individual chart elements were collected in a StringBuilder like this (VB.NET/ASP.NET code)

chartSB.AppendFormat("<set rowId='{0}' columnId='{1}' value='{2}'  ", rowID, colName, value)

if the "value" has actual value - it's displayed, but if it contains DbNull - it is displayed as blank. I didn't want to modify original dataset that feeds the chart, but I don't have to. If I replace DbNull with "0" just for the rendering - this does the trick:

chartSB.AppendFormat("<set rowId='{0}' columnId='{1}' value='{2}'  ", rowID, colName,  If(IsDBNull(value), "0", value))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top