Skip to content

Empty bar chart when plotting a single point using a date range #1601

@GabrielPereyra

Description

@GabrielPereyra

plotly==3.10.0

import datetime
from plotly.offline import plot

plot({
    'data': [{
        'x': [datetime.datetime(2019, 6, 6)],
        'y': [5],
        'type': 'bar'
    }],
    'layout': {
        'xaxis': {
            'range': [datetime.datetime(2019, 6, 1), datetime.datetime(2019, 6, 30)]
        }
    }
})

The following code leads to an empty chart. If I plot a single point with numeric values instead of datetimes, change the type to scatter, add a another datapoint or double-click the chart to zoom in, I get the expected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions