Skip to content

Default bar width on date axes should be smarter #6199

@nicolaskruchten

Description

@nicolaskruchten

Followup from plotly/plotly.py#3715 ... if I have a trace with a single bar in it and the x axis is datetime, then the width of that lonely bar ends up being like 1ms or something. This is never incorrect but also rarely the obviously right thing to do. A smarter behaviour would be to look at the "first non-zero date part" and make the bar that width, so:

  • 2022 -> 1 year
  • 2022-01-01 -> 1 year
  • 2022-02-01 -> 1 month
  • 2022-02-02 -> 1 day
  • 2022-02-02 10:00:00 -> 1 hour
  • 2022-02-02 10:05:00 -> 1 minute
  • 2022-02-02 10:05:12 -> 1 second

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