From: etimberg Date: Sat, 31 Oct 2015 01:04:45 +0000 (-0400) Subject: Polar area tooltip improvements X-Git-Tag: 2.0.0-beta1~42^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1596%2Fhead;p=thirdparty%2FChart.js.git Polar area tooltip improvements --- 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,