Skip to content

Restyling a date axis with timestamp data changes axis type to numeric #2144

Description

@jdugge

Starting with Plotly.js 1.31.0, restyling a plot using timestamps instead of date strings turns the axis from a date axis to a numeric axis, even if the original data was in the same format, as can be seen in this codepen. In 1.30.0, this didn't happen.

var trace1 = {
  x: [1509583143188, 1510187943188], 
  y: [1, 2]
};

var data = [ trace1];

var layout = {
  title:'Line and Scatter Plot',
  xaxis: { type: 'date'}
};

Plotly.newPlot('myDiv', data, layout);

// Restyling with the same data turns the axis from date to numeric type
Plotly.restyle('myDiv', {x: [[1509441408043, 1510046208043]], y: [[1, 2]]})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions