1👍
Resolved the Issue
We can’t give height and width to canvas in Chart.js. As per below document we should have dedicated div element for Canvas and give height and width to the div element(which i already did, check my code in question).
https://www.chartjs.org/docs/latest/general/responsive.html#configuration-options
After we should add below configurations for chart.
options: {
responsive: true,
maintainAspectRatio: false
}
- [Chartjs]-Using Chart.js in Web Worker
- [Chartjs]-How to use dates as X axis with Chart.js even when there is no Y axis value related
Source:stackexchange.com