From: serhii-yakymuk Date: Tue, 3 Apr 2018 07:23:16 +0000 (+0300) Subject: Fix line clipping at the chart area borders (#5321) X-Git-Tag: v2.7.3~1^2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c3e934062c2679d6e06905b342f6432dd7d87f6;p=thirdparty%2FChart.js.git Fix line clipping at the chart area borders (#5321) --- diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index 9d9206d5c..7aacf2d23 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -283,15 +283,23 @@ module.exports = function(Chart) { var points = meta.data || []; var area = chart.chartArea; var ilen = points.length; + var halfBorderWidth; var i = 0; - helpers.canvas.clipArea(chart.ctx, area); - if (lineEnabled(me.getDataset(), chart.options)) { + halfBorderWidth = (meta.dataset._model.borderWidth || 0) / 2; + + helpers.canvas.clipArea(chart.ctx, { + left: area.left, + right: area.right, + top: area.top - halfBorderWidth, + bottom: area.bottom + halfBorderWidth + }); + meta.dataset.draw(); - } - helpers.canvas.unclipArea(chart.ctx); + helpers.canvas.unclipArea(chart.ctx); + } // Draw the points for (; i < ilen; ++i) {