From 56614bf3d3da3fa56c27757d803909fa8f07b1cc Mon Sep 17 00:00:00 2001 From: jpmorgan Date: Sat, 22 Feb 2014 03:18:06 +1100 Subject: [PATCH] Format tooltip data according to ticks --- c3.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/c3.js b/c3.js index a3c5521..0c27826 100644 --- a/c3.js +++ b/c3.js @@ -138,7 +138,12 @@ text = "", i, value, name; for (i = 0; i < d.length; i++) { if (! d[i] || !(d[i].value || d[i].value === 0)) { continue; } - value = isDefined(d[i].value) ? (Math.round(d[i].value * 100) / 100).toFixed(2) : '-'; + + var value = '-'; + if (isDefined(d[i].value)) { + value = __axis_y_tick_format((Math.round(d[i].value * 100) / 100).toFixed(2)); + } + name = d[i].name; text += ""; }
" + title + "
" + name + "" + value + "