Hello!
Does anyone know how to change the angle or something else of the slider values, so that the text doesn’t overlap?
Hello!
Does anyone know how to change the angle or something else of the slider values, so that the text doesn’t overlap?
Here is an idea transforming those labels’ css.
import streamlit as st
st.markdown("""
<style>
[data-testid="stThumbValue"] {
transform: rotate(-20deg) translate(50%, 10%);
}
</style>
""", unsafe_allow_html=True
)
"# Rotated `stThumbValue`"
" "
value = st.select_slider(
"select_option",
options=range(0, 100, 10),
value=[30, 40],
format_func=lambda x: f"YEAR 2020.{x} 🦠",
label_visibility='collapsed'
)
Also, check bullet #3 from this blog post to learn more about those tweaks.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
There are a collection of GitHub issues about this too. If anyone comes across this and wants to upvote getting a solution built-in, here’s the designated issue for it (with other, closed issues merged into it as noted in the thread):
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.