The issue I am facing is that when my chart does not have any data loaded, it appears perfectly centered and contained within its element. However, when the chart has data, it gets pushed to the right and becomes smaller.
Here are the options I have set for the chart:
options: {
responsive: false,
maintainAspectRatio: false,
barRoundness: 1,
scaleShowValues: true,
scales: {
xAxes: [
{
barThickness: 6,
stacked: true,
ticks: {
autoSkip: false,
fontSize: 9
},
gridLines: { display: false }
}
],
yAxes: [{ stacked: false, gridLines: { display: false } }]
},
legend: {
display: false
},
tooltips: {
enabled: false
}
}
This is how I implement the chart:
<div v-if="loadedMatch" class="graph mt-2 rounded">
<newgraph :width="327" :height="312" :bets="this.betsForMatch"
v-if="loadedBets"
v-on:barInteracted="onBarInteracted"/>
</div>
https://i.sstatic.net/nNTMq.png
I am looking to have the chart fill the entire white space available.
Just to mention, I am using the vue-chart.js version of Chart.js. Apologies if I did not provide enough information initially.