Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit 2f3d9b5

Browse files
author
Luke Lowrey
committed
Save the context on drawing the median line as to not affect subsequent calls.
1 parent 649c30a commit 2f3d9b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/elements/boxandwhiskers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,14 @@ const BoxAndWiskers = Chart.elements.BoxAndWhiskers = ArrayElementBase.extend({
103103
ctx.lineTo(x, boxplot.q3);
104104
ctx.closePath();
105105
ctx.stroke();
106+
ctx.save();
106107
ctx.strokeStyle = vm.medianColor;
107108
ctx.beginPath();
108109
ctx.moveTo(x0, boxplot.median);
109110
ctx.lineTo(x0 + width, boxplot.median);
110111
ctx.closePath();
111112
ctx.stroke();
113+
ctx.restore();
112114
},
113115
_drawBoxPlotHoriz(vm, boxplot, ctx) {
114116
const y = vm.y;

0 commit comments

Comments
 (0)