Dhara
Dhara

Reputation: 312

Manually setting x and y axes in plotly.js

Like the code given below, Can we set X and Y axes manually for date and time respectively in plotly.js??

var layout = {
  xaxis: {range: [2, 5]},
  yaxis: {range: [2, 5]}
};

var layout = {
  xaxis: {range: ["2017-04-04", "2017-08-06"]},
  yaxis: {range: ["9:00:00", "24:00:00"]}
};

Upvotes: 8

Views: 10706

Answers (1)

mass
mass

Reputation: 83

Yes.You can do something like this.

var layout = {
  xaxis: {
    range: ['2017-04-04', '2017-08-06'],
    type: 'date'
  },
  yaxis: {
    autorange: true,
    range: [86.8700008333, 138.870004167],
    type: 'linear'
  }
};

ref : Plotly JS Reference

Upvotes: 6

Related Questions