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

Commit 8fcca46

Browse files
author
Adrian Wu
committed
Update lowerColor to optional
1 parent 330818f commit 8fcca46

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/elements/boxandwhiskers.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ const BoxAndWiskers = Chart.elements.BoxAndWhiskers = ArrayElementBase.extend({
106106
ctx.lineTo(x0 + width, boxplot.median);
107107

108108
// fill the part below the median with lowerColor
109-
ctx.fillStyle = vm.lowerColor;
110-
if (boxplot.q3 > boxplot.q1) {
111-
ctx.fillRect(x0, boxplot.median, width, boxplot.q3 - boxplot.median);
112-
} else {
113-
ctx.fillRect(x0, boxplot.median, width, boxplot.q1 - boxplot.median);
109+
if (vm.lowerColor) {
110+
ctx.fillStyle = vm.lowerColor;
111+
if (boxplot.q3 > boxplot.q1) {
112+
ctx.fillRect(x0, boxplot.median, width, boxplot.q3 - boxplot.median);
113+
} else {
114+
ctx.fillRect(x0, boxplot.median, width, boxplot.q1 - boxplot.median);
115+
}
114116
}
115117

116118
ctx.closePath();

0 commit comments

Comments
 (0)