plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Should Plotly.restyle throw error(s) when the update object isn't valid?

Open harshjv opened this issue 8 years ago • 6 comments

Consider this setup,

var data = [
  {
    y: ['22.3', '23'],
    x: ['2001-06-11 11:00', '2001-06-11 11:10'],
    line: {
      'width': 2
    },
    uid: '40abaa'
  }
]

var layout = {
  yaxis: {
    title: 'Rate'
  },
  margin: {
    l: 40, b: 40, r: 40, t: 40
  }
}

Plotly.plot('mydiv', data, layout)

This dosen't work, and clears the plot

var update = {
  x: ['2001-06-15 11:10', '2001-06-15 11:20'],
  y: ['23', '100.3']
}

Plotly.restyle('mydiv', update)

But this is working

var update = {
  y: ['23', '100.3']
}

Plotly.restyle('mydiv', update)

Plotly.restyle is handling two axis data update incorrectly and clears the existing data on the plot.

harshjv avatar Jan 07 '16 13:01 harshjv