We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f60eacd commit cf669b4Copy full SHA for cf669b4
lib/index.mjs
@@ -504,10 +504,12 @@ export const graph = (
504
505
ctx.strokeStyle = "rgba(50,50,50, 0.8)";
506
for (const marker of markers) {
507
- ctx.moveTo(lOffset, top_offset);
508
- ctx.lineTo(lOffset, top_offset + work_height);
+ const text = Array.isArray(marker) ? marker[1] : marker;
+ const xOffset = Array.isArray(marker) ? (work_width * marker[0]) + padding : lOffset;
509
+ ctx.moveTo(xOffset, top_offset);
510
+ ctx.lineTo(xOffset, top_offset + work_height);
511
ctx.stroke();
- ctx.fillText(marker, lOffset, top_offset + work_height - 14);
512
+ ctx.fillText(text, xOffset, top_offset + work_height - 14);
513
lOffset += marker_len;
514
}
515
0 commit comments