Add horizontal scrollbar and fix bar width

I am new to plotly.js. Kindly help me out

What I am getting:


What I want:

I don’t want to resize my graph according to data (as the bar width becomes small and hence difficult to see). Instead I want to have bar width fix and a horizontal scrollbar to view the remaining data

If I set xaxis: { autorange: false}, then my full data doesn’t appear

Hi I am also in the same dilemma. horizontal scroll bar doesn’t work

This would be nice to you.
Modify layout.width according to data’s length and add style for scroll as below.

<div id="myDiv" style="overflow:auto;"><!-- Plotly chart will be drawn inside this DIV --></div>
var data = [trace1, trace2];
let customWidth = trace1.x.length*50;
var layout = {
  width	:	customWidth,
  ...something that you added...
}

If you need more performance, use react() and relayout() instead of newPlot().

https://codepen.io/jornathan/pen/wvvWMzz