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

Streamlit's display of an Altair chart interferes with axis labels #4269

Closed
ryanlampkin opened this issue Jan 11, 2022 · 2 comments
Closed
Labels
feature:st.altair_chart status:awaiting-user-response Issue requires clarification from submitter type:bug Something isn't working

Comments

@ryanlampkin
Copy link

ryanlampkin commented Jan 11, 2022

I first posted my issue here on stackoverflow. I thought it was an altair / vega-lite issue. Now I believe it is a streamlit / altair issue. I've reproduced my analysis below.


I started with this reference point: vega/altair#1576.

For which I was able to display the x-axis label like so:

HRC2w

I'm using ordinal axis formatting in Altair to display dates (in order to skip weekend dates). I'm dynamically selecting valid dates within the dataframe's index, and yet, there are values that are not displaying on the chart.

It's not just these two missing values... certain dates just don't want to display (like "Jan 29, 2021", for which both prior and subsequent valid dates display fine).

Any ideas why these dates aren't showing up? Is this a datetime parsing issue? Even if I explicitly set a value (that works b/w streamlit and vega-lite) such as "Jan 29, 2021", it still won't display when calling the chart through Streamlit.

I cannot reproduce the error when I circumvent Streamlit, but when I chart through Streamlit, it appears Streamlit is reconfiguring the axis for display.

@ryanlampkin ryanlampkin added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Jan 11, 2022
@willhuang1997
Copy link
Collaborator

Hi @ryanlampkin , thanks for submitting this. Could you possibly give a code snippet so I can run and reproduce locally? If I am able to reproduce locally, I would be able to debug much more easily what is going on.

@willhuang1997 willhuang1997 added the status:awaiting-user-response Issue requires clarification from submitter label Feb 3, 2022
@lukasmasuch lukasmasuch removed the status:needs-triage Has not been triaged by the Streamlit team label Jul 26, 2022
@jrieke
Copy link
Collaborator

jrieke commented Jul 21, 2023

Closing since we changed the design of Altair charts a while back (which probably affects this issue) and there is no reproducible code example.

@jrieke jrieke closed this as completed Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.altair_chart status:awaiting-user-response Issue requires clarification from submitter type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants