Skip to content

Commit

Permalink
Make valueOrDefault and valueAtIndexOrDefault global
Browse files Browse the repository at this point in the history
  • Loading branch information
nagix committed Jan 10, 2019
1 parent bf39f49 commit 584408f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/plugins/plugin.legend.js
Expand Up @@ -7,6 +7,7 @@ var layouts = require('../core/core.layouts');

var noop = helpers.noop;
var valueOrDefault = helpers.valueOrDefault;
var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;

defaults._set('global', {
legend: {
Expand Down Expand Up @@ -51,8 +52,6 @@ defaults._set('global', {
var type = chart.getDatasetMeta(i).type;
var options = chart.options;
var legendOpts = options.legend;
var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;
var valueOrDefault = helpers.valueOrDefault;

var usePointStyle = legendOpts && legendOpts.labels && legendOpts.labels.usePointStyle;
var backgroundColor = usePointStyle ? valueAtIndexOrDefault(dataset.pointBackgroundColor, 0, dataset.backgroundColor) : dataset.backgroundColor;
Expand Down
2 changes: 1 addition & 1 deletion test/specs/plugin.legend.tests.js
Expand Up @@ -625,7 +625,7 @@ describe('Legend block tests', function() {
});
});

it('should pick up the first item when the propertiy is an array', function() {
it('should pick up the first item when the property is an array', function() {
var chart = window.acquireChart({
type: 'bar',
data: {
Expand Down

0 comments on commit 584408f

Please sign in to comment.