Hi I need a way to scroll left and right for my line chart and more spread out to see the values
https://imgur.com/HI470kH
import plotly.express as px
dateList = ResultsAll['DrawDate'].values.tolist()
prizeCodeList = ResultsAll['PrizeCode'].values.tolist()
lineChartDF = pd.DataFrame({
'date': dateList,
'prizeCode': prizeCodeList
})
lineChartDF = lineChartDF.set_index('date')
st.line_chart(lineChartDF, use_container_width=True)
Hi @apiusage, welcome to the Streamlit community!
Itβs important to note that st.line_chart
is meant as a convenience function, a quick start to getting something in the app. When you need more customization options, you can use st.altair_chart
, which will give you more ability to set the labels, complex charts with sliders, etc. For example, to make tooltips, have interactive axes and things like that, the code might look something like:
st.altair_chart(
alt.Chart(df)
.mark_line(tooltip=True)
.encode(x=x, y=y, color=alt.Color(group, legend=alt.Legend(orient="bottom")),)
.interactive(),
use_container_width=True,
)
Best,
Randy