0👍
You could set the aspectRatio
option in your configuration as a scriptable option where you can return the value coming from your logic, accessing to screen size or CSS and checking the value of min-width:
options: {
aspectRatio(ctx) {
// your logic
return yourValue;
},
....
}
- Chartjs-ChartJS sees date in string as numbers
- Chartjs-Moving vertical line when hovering over the chart using chart.js in v2.9.4
Source:stackexchange.com