-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Closed
Copy link
Labels
feature:st.altair_chartRelated to the `st.altair_chart` elementRelated to the `st.altair_chart` elementpriority:P3Medium priorityMedium prioritystatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expectedtype:regressionThis bug is a regression from previous behaviorThis bug is a regression from previous behaviorupstreamIssue caused by upstream dependencyIssue caused by upstream dependency
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
Axis shows blank and the chart shows blank for an altair chart when it is passed a datetime domain. Setting a domain for a non-datetime axis works (tried for quantitative, Q). Chart shows up correctly when passed to altair.show() which indicates this may be a bug with Streamlit.
Reproducible Code Example
import altair as alt
import pandas as pd
import streamlit as st
from vega_datasets import data
temps = data.seattle_temps()
temps = temps[temps.date.dt.hour == 10]
startDate = pd.to_datetime("2010-06-01")
endDate = pd.to_datetime("2010-06-30")
myScale = alt.Scale(domain=[startDate, endDate])
c = (
alt.Chart(temps)
.mark_line(clip=True)
.encode(x=alt.X("date:T", scale=myScale), y="temp:Q")
)
st.altair_chart(c)Steps To Reproduce
- Run the reproducible code (streamlit run app.py) in with Streamlit 1.15 and see that the chart is blank.
- Downgrade Streamlit to 1.13 and see that the chart displays as expected.
- Upgrade to Streamlit 1.14 to see that it does not work in version 1.14 either.
Expected Behavior
We expect that the domain adjusts the st.altair_chart axis when passed the datetime domain and that the data displays correctly.
Current Behavior
The chart and axis is blank.
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.15.0
- Python version: 3.10.8
- Operating System: Mac OSX 12.6.1
- Browser: Chrome
- Virtual environment: Pipenv
Additional Information
This error was reported by user xavierc on the Streamlit forums. Thanks xavierc for noticing it!
Are you willing to submit a PR?
- Yes, I am willing to submit a PR!
fradiniccolo, github-actions, claudia-dribia, danhamill and kennychowdhary
Metadata
Metadata
Assignees
Labels
feature:st.altair_chartRelated to the `st.altair_chart` elementRelated to the `st.altair_chart` elementpriority:P3Medium priorityMedium prioritystatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expectedtype:regressionThis bug is a regression from previous behaviorThis bug is a regression from previous behaviorupstreamIssue caused by upstream dependencyIssue caused by upstream dependency

