From: Akihiko Kusanagi Date: Sun, 2 Jul 2017 06:40:00 +0000 (+0900) Subject: Clip chart area before filling X-Git-Tag: v2.7.0~1^2~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e54bc594ace713ddc75a45bdfb7f1e8d11e2432;p=thirdparty%2FChart.js.git Clip chart area before filling - Add clip and unclip around doFill() call - This fixes #4450 --- diff --git a/src/plugins/plugin.filler.js b/src/plugins/plugin.filler.js index 9354e4ed5..2a91d38e8 100644 --- a/src/plugins/plugin.filler.js +++ b/src/plugins/plugin.filler.js @@ -296,6 +296,7 @@ module.exports = function(Chart) { return; } + var ctx = chart.ctx; var el = meta.el; var view = el._view; var points = el._children || []; @@ -303,7 +304,9 @@ module.exports = function(Chart) { var color = view.backgroundColor || defaults.global.defaultColor; if (mapper && color && points.length) { - doFill(chart.ctx, points, mapper, view, color, el._loop); + helpers.canvas.clipArea(ctx, chart.chartArea); + doFill(ctx, points, mapper, view, color, el._loop); + helpers.canvas.unclipArea(ctx); } } };