Skip to content

Commit 8b5d2d7

Browse files
authored
Fix lineWidth typo and adjust ctx.restore() placement
Fix lineWidth typo and adjust ctx.restore() placement Corrected 'ctx.linewidth' to 'ctx.lineWidth' to properly set line width in Canvas context. Moved 'ctx.restore()' to after both drawing operations to ensure context is restored at the appropriate time.
1 parent 4f4e9ad commit 8b5d2d7

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

BlazorExpress.ChartJS/wwwroot/blazorexpress.chartjs.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,18 +547,17 @@ window.blazorexpress.chartjs.line = {
547547
ctx.setLineDash([5, 5]);
548548
ctx.moveTo(activePoint.element.x, chart.chartArea.top);
549549
ctx.lineTo(activePoint.element.x, activePoint.element.y);
550-
ctx.linewidth = 2;
550+
ctx.lineWidth = 2;
551551
ctx.strokeStyle = 'grey';
552552
ctx.stroke();
553-
ctx.restore();
554553

555554
ctx.beginPath();
556-
ctx.setLineDash([5, 5]);
557555
ctx.moveTo(activePoint.element.x, activePoint.element.y);
558556
ctx.lineTo(activePoint.element.x, chart.chartArea.bottom);
559-
ctx.linewidth = 2;
557+
ctx.lineWidth = 2;
560558
ctx.strokeStyle = 'grey';
561559
ctx.stroke();
560+
562561
ctx.restore();
563562
}
564563
},

0 commit comments

Comments
 (0)