From: Evert Timberg Date: Fri, 20 Nov 2015 02:12:23 +0000 (-0500) Subject: Update default tooltip callbacks for bubble charts X-Git-Tag: 2.0.0-beta1~16^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1471a61609cbb7dc3a024d66517d6ad9277eecce;p=thirdparty%2FChart.js.git Update default tooltip callbacks for bubble charts --- diff --git a/src/charts/Chart.Bubble.js b/src/charts/Chart.Bubble.js index d4715c026..a6b03c1fc 100644 --- a/src/charts/Chart.Bubble.js +++ b/src/charts/Chart.Bubble.js @@ -24,14 +24,24 @@ }, tooltips: { - template: "(<%= value.x %>, <%= value.y %>)", - multiTemplate: "<%if (datasetLabel){%><%=datasetLabel%>: <%}%>(<%= value.x %>, <%= value.y %>)", + callbacks: { + title: function(tooltipItems, data) { + // Title doesn't make sense for scatter since we format the data as a point + return ''; + }, + label: function(tooltipItem, data) { + return '(' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ')'; + } + } }, }; + // Register the default config for this type + Chart.defaults.bubble = defaultConfig; + Chart.Bubble = function(context, config) { - config.options = helpers.configMerge(defaultConfig, config.options); + //config.options = helpers.configMerge(defaultConfig, config.options); config.type = 'bubble'; return new Chart(context, config); };