Browse Source

Control whether tooltip is displayed by value

pull/879/head
Chris Vaszauskas 10 years ago
parent
commit
e60f0f9e68
  1. 4
      src/tooltip.js

4
src/tooltip.js

@ -38,8 +38,9 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul
text = "<table class='" + CLASS.tooltip + "'>" + (title || title === 0 ? "<tr><th colspan='2'>" + title + "</th></tr>" : ""); text = "<table class='" + CLASS.tooltip + "'>" + (title || title === 0 ? "<tr><th colspan='2'>" + title + "</th></tr>" : "");
} }
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); value = valueFormat(d[i].value, d[i].ratio, d[i].id, d[i].index);
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); bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id);
text += "<tr class='" + CLASS.tooltipName + "-" + d[i].id + "'>"; text += "<tr class='" + CLASS.tooltipName + "-" + d[i].id + "'>";
@ -47,6 +48,7 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul
text += "<td class='value'>" + value + "</td>"; text += "<td class='value'>" + value + "</td>";
text += "</tr>"; text += "</tr>";
} }
}
return text + "</table>"; return text + "</table>";
}; };
c3_chart_internal_fn.tooltipPosition = function (dataToShow, tWidth, tHeight, element) { c3_chart_internal_fn.tooltipPosition = function (dataToShow, tWidth, tHeight, element) {

Loading…
Cancel
Save