From 0bf19105d61f5632581c68e9fbab4be2dd473a68 Mon Sep 17 00:00:00 2001 From: loicbourgois Date: Sun, 28 Jan 2018 10:54:39 +0000 Subject: [PATCH] Refactor --- src/controllers/controller.bar.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/controllers/controller.bar.js b/src/controllers/controller.bar.js index b2ce4dfb444..01c2a88b3d6 100644 --- a/src/controllers/controller.bar.js +++ b/src/controllers/controller.bar.js @@ -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() {