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

Method drawLine

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected