diff --git a/src/tooltip.js b/src/tooltip.js index 59af9fc..50446f1 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -38,14 +38,16 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul text = "" + (title || title === 0 ? "" : ""); } - name = nameFormat(d[i].name, d[i].ratio, d[i].id, d[i].index); value = valueFormat(d[i].value, d[i].ratio, d[i].id, d[i].index); - bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id); + if (value !== undefined) { + name = nameFormat(d[i].name, d[i].ratio, d[i].id, d[i].index); + bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id); - text += ""; - text += ""; - text += ""; - text += ""; + text += ""; + text += ""; + text += ""; + text += ""; + } } return text + "
" + title + "
" + name + "" + value + "
" + name + "" + value + "
"; };