Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

need to remove a gap between elements of stacked bar

Open delkris opened this issue 1 year ago • 10 comments

Expected behavior

Hi, it was expected that there would be no gap between elements of bar when adding property "minBarLength"

Current behavior

image

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

delkris avatar Sep 27 '23 09:09 delkris

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.

ianujvarshney avatar Sep 27 '23 09:09 ianujvarshney

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

LeeLenaleee avatar Sep 27 '23 10:09 LeeLenaleee

Please assign this issue to me.

Sahil-K123 avatar Sep 28 '23 16:09 Sahil-K123

Hello would like to fix is this still required can you assign me?

SiddharthaKR avatar Oct 02 '23 07:10 SiddharthaKR

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

No. The gap has still exist in the first column.

delkris avatar Oct 02 '23 16:10 delkris

Same issue here

kristijan11b avatar Feb 07 '24 10:02 kristijan11b

+1

eralmione avatar Feb 27 '24 14:02 eralmione

any updates?

serhii-kaliuzhnyi-dev avatar Mar 25 '24 15:03 serhii-kaliuzhnyi-dev

Chart.js v4.4.3 still same problem. Can't adjust (completely remove) gap/space between columns image Hoping fix comes soon

pashaUSA avatar May 23 '24 14:05 pashaUSA

Oh, I figured it out: image 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, },

pashaUSA avatar May 29 '24 21:05 pashaUSA