diff --git a/src/tooltip.js b/src/tooltip.js index 720c33b..696394f 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -76,12 +76,15 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul // value will be formatted the same way as the other values if (config.tooltip_total_show) { totalValue = 0; - for (i=0; i < d.length; i++) { + for (i = 0; i < d.length; i++) { + if (! (d[i] && (d[i].value || d[i].value === 0))) { continue; } totalValue += d[i].value; } totalValue = totalValueFormat(totalValue); - text += "