Hi,
I am having weird issue , line chart shows the date on label Jan 14, but my data starts from Jan 15
I am using , streamlit → 1.22 version
Hi,
I am having weird issue , line chart shows the date on label Jan 14, but my data starts from Jan 15
I am using , streamlit → 1.22 version
Hi @rshah25
It would also be helpful to also share the code snippet or GitHub repo to the app. The date select widget is indeed showing date at a later point in time from what is displayed in the plot. It may have been due to some subsequent processing, which can be figured out from looking at the code.
sql = f"""
select date(created_at) as Appointment_Date, count(*) as Total
from table
group by date(created_at)
order by date(created_at)
"""
data = session.sql(sql).collect()
chart_pandas_df = pd.DataFrame(data,columns=["Appointment_Date","Total"])
r2col1,r2col2 = st.columns([3,4])
with r2col1:
#STEP 6: SHOW UNDERLYING DATA
st.subheader("Underlying Data")
st.dataframe(data=chart_pandas_df)
with r2col2:
#st.subheader("")
st.line_chart(chart_pandas_df,x="Appointment_Date",y="Total")
This is very simple code.
Jan 14 2024 is showing up , it should be Jan 15 2024
Hi @rshah25
This is more of a data wrangling issue.
You could use Pandas’ unique()
method to retrieve a list of unique values of the Appointment_date
column and then use slicing to select a subset of data so that it starts from the next unique value (Jan 15, 2024) from the minimum value (Jan 14, 2024).
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.