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;
|
return bx + bw / 2;
|
||||||
}
|
}
|
||||||
function traceCurve() {
|
function traceCurve() {
|
||||||
ctx.moveTo(0, yOf(d[0]));
|
|
||||||
if (n === 1) {
|
if (n === 1) {
|
||||||
ctx.lineTo(width, yOf(d[0]));
|
ctx.lineTo(width, yOf(d[0]));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -127,6 +126,7 @@ Canvas {
|
||||||
const baseY = lo < 0 ? yOf(0) : height;
|
const baseY = lo < 0 ? yOf(0) : height;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(0, baseY);
|
ctx.moveTo(0, baseY);
|
||||||
|
ctx.lineTo(0, yOf(d[0]));
|
||||||
traceCurve();
|
traceCurve();
|
||||||
ctx.lineTo(width, baseY);
|
ctx.lineTo(width, baseY);
|
||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
|
|
@ -158,6 +158,7 @@ Canvas {
|
||||||
|
|
||||||
// Stroke line on top
|
// Stroke line on top
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(0, yOf(d[0]));
|
||||||
traceCurve();
|
traceCurve();
|
||||||
ctx.strokeStyle = strokeColor.toString();
|
ctx.strokeStyle = strokeColor.toString();
|
||||||
ctx.lineWidth = root.lineWidth;
|
ctx.lineWidth = root.lineWidth;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue