Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stacked bars not rendered correctly with datetime axis #6288

Closed
TheoMathurin opened this issue Jun 18, 2024 · 3 comments · Fixed by #6365
Closed

Stacked bars not rendered correctly with datetime axis #6288

TheoMathurin opened this issue Jun 18, 2024 · 3 comments · Fixed by #6365
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@TheoMathurin
Copy link
Contributor

TheoMathurin commented Jun 18, 2024

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.

@TheoMathurin
Copy link
Contributor Author

Any idea where to look for in order to fix this? I'm willing to spend some time as this bug prevents me from updating to 1.19.

@MarcSkovMadsen
Copy link
Collaborator

On holiday ⛱️ find the PR adding support for continous axis. Find the file(s) that changed. Try to debug basic example and figure out how it works.

@philippjfr
Copy link
Member

I'll take a quick look at it, I suspect we didn't consider the grouped/stacked conditions at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants