From: Denny Biasiolli Date: Fri, 3 Jun 2016 08:49:06 +0000 (+0200) Subject: legend: fix rendering in browsers other than Chrome when dataset.backgroundColor... X-Git-Tag: v2.1.5~18^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F2698%2Fhead;p=thirdparty%2FChart.js.git legend: fix rendering in browsers other than Chrome when dataset.backgroundColor is Array --- diff --git a/src/core/core.legend.js b/src/core/core.legend.js index f625bb881..6b18c0a70 100644 --- a/src/core/core.legend.js +++ b/src/core/core.legend.js @@ -44,7 +44,7 @@ module.exports = function(Chart) { return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) { return { text: dataset.label, - fillStyle: dataset.backgroundColor, + fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]), hidden: !chart.isDatasetVisible(i), lineCap: dataset.borderCapStyle, lineDash: dataset.borderDash,