Plotly.js - How to fix space between bars in barchart

Is there any configuration layout option to increase the space between the strips on the line chart in plotly.js?

I tried to increase the width of the graph, but it expands the plot as a whole. I need to fix the width of the strip and the space between the columns.

Any help would be very helpful.

+4
source share
1 answer

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.

+2
source

Source: https://habr.com/ru/post/1659017/


All Articles