Skip to content

Stacked bars not rendered correctly with datetime axis #6288

@TheoMathurin

Description

@TheoMathurin

With HoloViews 1.19.0, #6145 brought an interesting feature with continuous axis support for hv.Bars.

However, now when the stacked option is enabled, bars are not rendered correctly on a datetime x-axis. As an aside, xlims seem to be ignored.

import datetime as dt
import holoviews as hv
import pandas as pd

data = pd.DataFrame({"x": pd.to_datetime(["2017-01-01T00:00:00",
                                          "2017-01-01T00:00:00",
                                          "2017-01-01T01:00:00",
                                          "2017-01-01T01:00:00",
                                          "2017-01-01T02:00:00",
                                          "2017-01-01T02:00:00"]),
                     "cat": ["A", "B", "A", "B", "A", "B"],
                     "y": [0, 2, 1, 5, 1, 2]})
hv.Bars(data, ["x", "cat"], ["y"]).opts(
    width=600, stacked=True, xlim=(dt.datetime(2017, 1, 1), dt.datetime(2017, 1, 2)))

issue_bars

The horizontal elements displayed extend across the x-axis just as HLine or HSpan.

I have no error in python or in the browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't correct or isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions