I am looking to use Chart.js to create a single stacked bar chart that visualizes progress towards a specific financial goal. I have added a dotted line on top of the chart to represent this goal amount.
The issue I am facing is that there is unwanted padding on the canvas of the chart, causing the line to extend beyond the chart boundaries. How can I eliminate this padding on the left and right sides?
I attempted to adjust the padding using negative values as recommended in a previous post, but it did not resolve the issue.
const options = {
layout: {
padding: -40,
},
};
Code sandbox: https://codesandbox.io/s/romantic-paper-kfu6o7?file=/src/App.js