Is there any configuration layout option to increase the space between the bars in a bar plot in plotly.js ?
I tried increasing the width of the plot but it is expanding the plot as a whole.I need to fix the width of the bar and space between the bars.
Any help would be highly helpful.
It is a setting of layout The key value pair for the layout object to change the gap is bargap
. For example given arrays x
and y
:
Plotly.newPlot('myDiv', [{x:x, y:y, type:'bar'}],{title:'title',xaxis: {title: 'abscissa'},yaxis:{title:'ordinate'},bargap:0});
Will generate a plot with no gap like a histogram.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With