From 6176a9b1a9158f16c169759eb79127f94b8e5bcd Mon Sep 17 00:00:00 2001 From: Chris Vaszauskas Date: Thu, 25 Sep 2014 14:46:03 -0500 Subject: [PATCH 1/2] Add index to tooltip name format function --- src/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tooltip.js b/src/tooltip.js index 1603993..911eae2 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -38,7 +38,7 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul text = "" + (title || title === 0 ? "" : ""); } - name = nameFormat(d[i].name); + name = nameFormat(d[i].name, 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); From 51cac5791913ecf5c7dd43987c27022c80ac2a9f Mon Sep 17 00:00:00 2001 From: Chris Vaszauskas Date: Thu, 25 Sep 2014 14:47:13 -0500 Subject: [PATCH 2/2] Make nameFormat arguments the same as valueFormat --- src/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tooltip.js b/src/tooltip.js index 911eae2..b657bbc 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -38,7 +38,7 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul text = "
" + title + "
" + (title || title === 0 ? "" : ""); } - name = nameFormat(d[i].name, d[i].index); + 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);
" + title + "