From c316f90999b65ffdd6897b5f469b4682b7dd71d0 Mon Sep 17 00:00:00 2001 From: etimberg Date: Fri, 30 Oct 2015 21:04:45 -0400 Subject: [PATCH] Polar area tooltip improvements --- src/controllers/controller.polarArea.js | 11 +++++++++++ src/core/core.tooltip.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/controllers/controller.polarArea.js b/src/controllers/controller.polarArea.js index 45e4b33a5..6bcc6e0df 100644 --- a/src/controllers/controller.polarArea.js +++ b/src/controllers/controller.polarArea.js @@ -17,6 +17,16 @@ //Boolean - Whether to animate the rotation of the chart animateRotate: true, animateScale: true, + + // Need to override these to give a nice default + tooltips: { + callbacks: { + title: function() { return '' }, + label: function(tooltipItem, data) { + return data.labels[tooltipItem.index] + ': ' + tooltipItem.yLabel; + } + } + } }; Chart.controllers.polarArea = function(chart, datasetIndex) { @@ -143,6 +153,7 @@ _chart: this.chart.chart, _datasetIndex: this.index, _index: index, + _scale: this.chart.scale, // Desired view properties _model: reset ? resetModel : { diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index bc6079549..40ec7e9d1 100644 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -104,9 +104,9 @@ bodyColor: options.tooltips.bodyColor, _bodyFontFamily: options.tooltips.bodyFontFamily, _bodyFontStyle: options.tooltips.bodyFontStyle, + _bodyAlign: options.tooltips.bodyAlign, bodyFontSize: options.tooltips.bodyFontSize, bodySpacing: options.tooltips.bodySpacing, - _bodposition: options.tooltips.bodposition, // Title titleColor: options.tooltips.titleColor, -- 2.47.2