Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
loicbourgois committed Jan 28, 2018
1 parent 87929a4 commit 0bf1910
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/controllers/controller.bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,13 @@ module.exports = function(Chart) {
var dataset = me.getDataset();
var index = rectangle._index;
var custom = rectangle.custom || {};
var model = rectangle._model;
options = options ? options : this.getElementOptions();

rectangle._model.borderSkipped = custom.borderSkipped ? custom.borderSkipped : options.borderSkipped;
rectangle._model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, options.backgroundColor);
rectangle._model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, options.borderColor);
rectangle._model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, options.borderWidth);
model.borderSkipped = custom.borderSkipped ? custom.borderSkipped : options.borderSkipped;
model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, options.backgroundColor);
model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, options.borderColor);
model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, options.borderWidth);
},

getElementOptions: function() {
Expand Down

0 comments on commit 0bf1910

Please sign in to comment.