sparkline: fix missing bottom-left fill corner
This commit is contained in:
parent
f6c93ad9d9
commit
034f0b6d85
1 changed files with 2 additions and 1 deletions
|
|
@ -109,7 +109,6 @@ Canvas {
|
|||
return bx + bw / 2;
|
||||
}
|
||||
function traceCurve() {
|
||||
ctx.moveTo(0, yOf(d[0]));
|
||||
if (n === 1) {
|
||||
ctx.lineTo(width, yOf(d[0]));
|
||||
} else {
|
||||
|
|
@ -127,6 +126,7 @@ Canvas {
|
|||
const baseY = lo < 0 ? yOf(0) : height;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, baseY);
|
||||
ctx.lineTo(0, yOf(d[0]));
|
||||
traceCurve();
|
||||
ctx.lineTo(width, baseY);
|
||||
ctx.closePath();
|
||||
|
|
@ -158,6 +158,7 @@ Canvas {
|
|||
|
||||
// Stroke line on top
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, yOf(d[0]));
|
||||
traceCurve();
|
||||
ctx.strokeStyle = strokeColor.toString();
|
||||
ctx.lineWidth = root.lineWidth;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue