MCPcopy Create free account
hub / github.com/chartjs/Chart.js / drawLine

Method drawLine

src/core/core.scale.js:1474–1489  ·  view source on GitHub ↗
(p1, p2, style)

Source from the content-addressed store, hash-verified

1472 let i, ilen;
1473
1474 const drawLine = (p1, p2, style) => {
1475 if (!style.width || !style.color) {
1476 return;
1477 }
1478 ctx.save();
1479 ctx.lineWidth = style.width;
1480 ctx.strokeStyle = style.color;
1481 ctx.setLineDash(style.borderDash || []);
1482 ctx.lineDashOffset = style.borderDashOffset;
1483
1484 ctx.beginPath();
1485 ctx.moveTo(p1.x, p1.y);
1486 ctx.lineTo(p2.x, p2.y);
1487 ctx.stroke();
1488 ctx.restore();
1489 };
1490
1491 if (grid.display) {
1492 for (i = 0, ilen = items.length; i < ilen; ++i) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected