3๐
I believe that following settings will work for you. Set responsive to true, maintainAspectRatio to false in the chart options and set style as like as max-height: 300px; width: auto;
- [Chartjs]-X-axis multiple colored label for bar chart using chart.js
- [Chartjs]-Hiding unused axis in ng2-charts
0๐
You could try giving it a min-width
(something like 200px) and height: auto
.
- [Chartjs]-Hide empty bars in Grouped Stacked Bar Chart โ chart.js
- [Chartjs]-Chart JS custom tooltip not showing
0๐
I know this thread is a bit old โ but this worked for me
plugins: {
legend: {
display: true,
position: function () {
//you can return position based on inner width of your display area
if (window.innerWidth < 600) {
return "bottom";
}
- [Chartjs]-Custom tooltips with react-chartjs-2 library
- [Chartjs]-Chart.js: Display only the horizontal gridline at zero index
Source:stackexchange.com