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

Allow each bar in a bar chart to have a different width

Open kennysong opened this issue 2 years ago • 6 comments

Feature Proposal

Currently, the barThickness option only takes a single number as input. If we could pass in an array, then each bar could have its own width.

This is similar to properties like backgroundColor and borderColor, which can take a single value or an array of values for each point in the dataset.

Feature Use Case

I'd like to make a bar chart where the width of the bar indicates the "size" of that category (the y-axis measures an average of all points in that category).

kennysong avatar Oct 17 '21 08:10 kennysong

@kennysong Assign this to me

kitarp29 avatar Oct 17 '21 20:10 kitarp29

I'm also interested! :)

Yarflam avatar Jan 11 '22 11:01 Yarflam

Any update on this? Definitely would love to see it!

escully27 avatar Jun 19 '22 04:06 escully27

Anybody?

Shaun-Li avatar Jul 05 '22 07:07 Shaun-Li

In the meantime I built this out with Plotly library instead.

https://plotly.com/javascript/bar-charts/#customizing-individual-bar-widths

escully27 avatar Jul 05 '22 18:07 escully27

any updates on this?

Zilvinaskli avatar Oct 13 '22 12:10 Zilvinaskli