Per the documentation, st.line_chart is a wrapper on an altair function. What is the raw altair code that will exactly replicate what st.line_chart does?
Thanks
Per the documentation, st.line_chart is a wrapper on an altair function. What is the raw altair code that will exactly replicate what st.line_chart does?
Thanks
Thank you for the reply.
Do you know of anyway to adjust the scale of the line chart?The default is 0 to 1, but it should be the minimum y-axis point to the maximum y-axis point?
Thanks
Yes!
So I have found that st.line_chart() works really well when I don’t need to be too specific about how the graph exactly looks, but when I need to do things like make the scale something very specific, I’ll use altair directly. So an example for changing the scale might be:
alt.Chart(my_data_frame).mark_line().encode(
x = alt.X('my_column_name')
y = alt.Y('my_y_col_name', scale=alt.Scale(domain=[0, 50]))
)
where 50 is the upper bound.
Also line_chart should automatically adjust the upper bound for you, does it only go to 0,1?
Thanks so much for the help thus far, unfortunately altair is just out of the range of my current skillset so I will have to find another solution. I also thought that the data would automatically scale, but nope.
I posted a picture of this problem in a different post: Scale y-axis using st.line_chart [Please?]
Ah ok! Well we’ll try to answer your question in the other post after you post your code.
This topic was automatically closed 365 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.