Wednesday, 16 September 2020

Did anyone use chartjs-node-canavas. My image is overflowing when i use ctx.scale()

codeSo I always want a good image, which I can zoom and see the content clearly. I tried to use the scale option, but it make the images zoomed and overflows it.Am I missing something ??Note: without scaling the code works fine, but I want an image that I can zoom and see clearly ChartJS.plugins.register({ // plugin implementation beforeDraw: function (chart, easing) { var ctx = chart.chart.ctx; ctx.scale(2, 2); //ctx.scale(1,1) works fine ctx.save(); ctx.fillStyle = "#ffffff"; ctx.fillRect(0, 0, chart.width, chart.height); ctx.restore(); } }); Thanks

Submitted September 17, 2020 at 03:30AM by DVGY

No comments:

Post a Comment