Chart.js
Chart.js copied to clipboard
need to remove a gap between elements of stacked bar
Expected behavior
Hi, it was expected that there would be no gap between elements of bar when adding property "minBarLength"
Current behavior
In January bar the gap appears. it happens after adding property "minBarLength"
Reproducible sample
https://stackblitz.com/edit/github-f6olvx?file=src%2FchartConfig.ts
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
v4.3.0
Browser name and version
No response
Link to your project
No response
Dear ,
I'm Anuj Varshney, experienced in resolving such issues efficiently. Kindly assign it to me. I'll work diligently and keep you updated. Excited to contribute.
If you set the barPercentage
and categoryPercentage
both to 1
the space will disappear.
https://www.chartjs.org/docs/4.4.0/charts/bar.html#barpercentage-vs-categorypercentage
https://stackblitz.com/edit/github-f6olvx-1mtrxz?file=src%2FchartConfig.ts
Please assign this issue to me.
Hello would like to fix is this still required can you assign me?
If you set the
barPercentage
andcategoryPercentage
both to1
the space will disappear.https://www.chartjs.org/docs/4.4.0/charts/bar.html#barpercentage-vs-categorypercentage
https://stackblitz.com/edit/github-f6olvx-1mtrxz?file=src%2FchartConfig.ts
No. The gap has still exist in the first column.
Same issue here
+1
any updates?
Chart.js v4.4.3 still same problem. Can't adjust (completely remove) gap/space between columns
Hoping fix comes soon
Oh, I figured it out:
the
categoryPercentage: 1.0,
barPercentage: 1.0,
needs to be used inside of the dataset definition.
datasets: [
{
label: "Run",
data: runData,
backgroundColor: "#00b94b",
borderColor: "#00b94b",
borderWidth: 0,
categoryPercentage: 1.0,
barPercentage: 1.0,
},