Skip to content

Commit 584408f

Browse files
committed
Make valueOrDefault and valueAtIndexOrDefault global
1 parent bf39f49 commit 584408f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/plugins/plugin.legend.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var layouts = require('../core/core.layouts');
77

88
var noop = helpers.noop;
99
var valueOrDefault = helpers.valueOrDefault;
10+
var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;
1011

1112
defaults._set('global', {
1213
legend: {
@@ -51,8 +52,6 @@ defaults._set('global', {
5152
var type = chart.getDatasetMeta(i).type;
5253
var options = chart.options;
5354
var legendOpts = options.legend;
54-
var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;
55-
var valueOrDefault = helpers.valueOrDefault;
5655

5756
var usePointStyle = legendOpts && legendOpts.labels && legendOpts.labels.usePointStyle;
5857
var backgroundColor = usePointStyle ? valueAtIndexOrDefault(dataset.pointBackgroundColor, 0, dataset.backgroundColor) : dataset.backgroundColor;

test/specs/plugin.legend.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ describe('Legend block tests', function() {
625625
});
626626
});
627627

628-
it('should pick up the first item when the propertiy is an array', function() {
628+
it('should pick up the first item when the property is an array', function() {
629629
var chart = window.acquireChart({
630630
type: 'bar',
631631
data: {

0 commit comments

Comments
 (0)