1π
The only thing that has worked for me is setting the height and width on the component as such:
<BarChart
:chart-data="chart2Data"
:options="chart2Options"
:key="chart2Trigger"
:height="2"
:width="4"
/>
- [Chartjs]-Allow display of multiple data attributes in tooltip of Chart.js
- [Chartjs]-How to generate color code dynamically by swapping 2 characters within a string using PHP
0π
I got same problem and found this.
https://www.chartjs.org/docs/latest/general/responsive.html#important-note
Try this
<bar-chart
:chart-data="datacollection"
:options="options"
:styles="myStyles" <-- add this
chart-id="projectedCumulativeSavings"
/>
And
computed: {
myStyles() {
return {
height: '20vh', <-- this makes your chart responsive
position: 'relative',
};
},
- [Chartjs]-How can I automatically wrap tooltip text content to multiple lines?
- [Chartjs]-Inline plugin doesn't work
Source:stackexchange.com