Skip to content

Commit 879efd5

Browse files
Fix pie chart label issue #981
1 parent 171b2a4 commit 879efd5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

js/render-chartjs.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,15 @@
122122
settings.plugins.tooltip = {
123123
callbacks: {
124124
label: function(context) {
125-
var label = context.dataset.label || '';
125+
var label = '';
126+
if ( 'object' === typeof context.dataset.label ) {
127+
label = context.label || '';
128+
} else {
129+
label = context.dataset.label || '';
130+
}
126131
if ( label ) {
127132
label += ': ';
128133
}
129-
130134
var format = context.dataset.format || '';
131135
if ( format ) {
132136
label += format_datum( context.formattedValue, format );

0 commit comments

Comments
 (0)