How do i change the width of each the bar

Plotly.plot(gd, [{
type: ‘bar’,
x: [1, 2, 3, 4],
y: [5, 10, 2, 12],
marker: {
color: ‘#C8A2C8’,
line: {
width: 0.5
}
}
}], {
title: ‘Auto-Resize’,
font: {
size: 16
}
});

change width for all bars .
Can you please help on this.
Thanks

Are you referring to the bordering line width of each bar or the width of the bars themselves?

If the former try: http://codepen.io/etpinard/pen/RGBQNb

If the latter, you’ll have to wait a few weeks for https://github.com/plotly/plotly.js/issues/80 to be completed.

not the bordering line width . is the width of the bars themselves.

This is now doable in plotly.js 1.19.1: http://codepen.io/etpinard/pen/RGmpgz

1 Like

How do you change the exact absolute width of the bar graph in python?

Is it possible to make bar width based on a time range? So if I have two events: one from 11 to 11:30 and another from 12:10 to 1:00 then I will have two bars where one starts at 11 and ends at 11:30 and another starts at 12:10 and ends at 1:00. Is it doable?

Thanks

@Zolotoy
It is possible by computing width like this Demo.