Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotly.js: Initial Zoom

Tags:

plotly

I have 256 data points. When the plot first appears I'd like the x axis to be automatically zoomed to a specific range along the X axis. Is there way? Must I punch down to D3 somehow?

like image 673
Kenny Avatar asked Apr 19 '16 01:04

Kenny


1 Answers

Something like:

Plotly.plot('graph', [{
  /* some data trace */
}], {
  xaxis: {
    range: [0, 1]  // to set the xaxis range to 0 to 1
  }
});

More info in the plotly.js chart attributes reference.

like image 178
etpinard Avatar answered Sep 18 '22 07:09

etpinard