Fixed height on bar chart

Hi, I'm currently working on a bar chart. I want every bars on my chart to have fixed height. How can I achieve that result ? This is my current bar chart, it automatically adjust its height.   Image 1 ) Image 2 )   Thank you : )
3 answers

Hi Putharin,

The idea of a bar chart is that it gives you a visual representation of differences between values. If you want them to be of the same length however, you can do this by setting/manipulating the values right? Give every bar the same value, and it'll be the same lenght. Actual size of the element on your page (and subsequently, size of the bars on your screen) can be manipulated using css.

Let me know if you need any additional help!


Hi Phutharin,

My bad, I misunderstood your question. If you are using this Chart widget ( you'll have (lmost) endless customization possibilities, of which most can be found in the widget documentation. Bar width however isn't. But, since you can use all plotly.js features, you can check out the below url to find your desired customization properties. Good luck!

Hi again,

I can finally see what I want to achieve now.

So basically I want this height of the bar chart here,

to be automatically adjusted based on how many data is in the chart.

For instance,

100 * 1 for 1 data

100 * 2 for 2 data

100 * 3 for 3 data


Where do I have to customize in order to achieve this result ?

Thank you :)