]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Polar area tooltip improvements 1596/head
authoretimberg <evert.timberg@gmail.com>
Sat, 31 Oct 2015 01:04:45 +0000 (21:04 -0400)
committeretimberg <evert.timberg@gmail.com>
Sat, 31 Oct 2015 01:04:45 +0000 (21:04 -0400)
src/controllers/controller.polarArea.js
src/core/core.tooltip.js

index 45e4b33a57baecf6ef5fbde7ca577688ba3c0386..6bcc6e0df1e7a58a3e0ae5dfd91694dac097d89c 100644 (file)
                //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) {
                                _chart: this.chart.chart,
                                _datasetIndex: this.index,
                                _index: index,
+                               _scale: this.chart.scale,
 
                                // Desired view properties
                                _model: reset ? resetModel : {
index bc6079549f6ed392ab696fbd91ffcbdaa09027e3..40ec7e9d17d4f0dbc81a63fd28973d8b7cd34c46 100644 (file)
                                        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,