You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/library/api/charts/altair_chart.md
+111Lines changed: 111 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,117 @@ description: st.altair_chart displays a chart using the Altair library.
6
6
7
7
<Autofunctionfunction="streamlit.altair_chart" />
8
8
9
+
### Theming
10
+
11
+
Altair charts are displayed using the Streamlit theme by default. This theme is sleek, user-friendly, and incorporates Streamlit's color palette. The added benefit is that your charts better integrate with the rest of your app's design.
12
+
13
+
The new Streamlit theme is available from Streamlit 1.16.0 through the `theme="streamlit"` keyword argument. To disable it, and use Altair's native theme, use `theme=None` instead.
14
+
15
+
Let's look at an example of charts with the Streamlit theme and the native Altair theme:
If you're wondering if your own customizations will still be taken into account, don't worry! If you're an experienced Altair user and like to have your own special customizations, your changes in the chart configurations will still be taken into account. Here's an example of an Altair chart where manual color passing is done and reflected:
For many more examples of Altair charts with and without the Streamlit theme, check out the [altair.streamlit.app](https://altair.streamlit.app).
119
+
9
120
### Annotating charts
10
121
11
122
Altair also allows you to annotate your charts with text, images, and emojis. You can do this by creating [layered charts](https://altair-viz.github.io/user_guide/compound_charts.html#layered-charts), which let you overlay two different charts on top of each other. The idea is to use the first chart to show the data, and the second chart to show the annotations. The second chart can then be overlaid on top of the first chart using the `+` operator to create a layered chart.
Plotly charts are displayed using the Streamlit theme by default. This theme is sleek, user-friendly, and incorporates Streamlit's color palette. The added benefit is that your charts better integrate with the rest of your app's design.
12
+
13
+
The new Streamlit theme is available from Streamlit 1.16.0 through the `theme="streamlit"` keyword argument. To disable it, and use Plotly's native theme, use `theme=None` instead.
14
+
15
+
Let's look at an example of charts with the Streamlit theme and the native Plotly theme:
If you're wondering if your own customizations will still be taken into account, don't worry! If you're an experienced Plotly user and like to have your own special customizations, your changes in the chart configurations will still be taken into account. Here's an example of an Plotly chart where a custom color scale is defined and reflected:
0 commit comments