This is the layout setting. The key parameter for the layout object to change the gap is bargap. For example, given arrays xand y:
Plotly.newPlot('myDiv', [{x:x, y:y, type:'bar'}],{title:'title',xaxis: {title: 'abscissa'},yaxis:{title:'ordinate'},bargap:0});
It will generate a graph without a gap, like a histogram.
source
share