streamlit-component-gallery / pages /charts.area_chart2.py
whitphx's picture
whitphx HF staff
Copy sample files from streamlit/docs/python/api-examples-source/* (4e54057)
9c1ffe9
raw
history blame contribute delete
358 Bytes
import numpy as np
import pandas as pd
import streamlit as st
@st.cache_data
def load_data():
df = pd.DataFrame(
np.random.randn(20, 3),
columns = ['col1', 'col2', 'col3'])
return df
chart_data = load_data()
st.area_chart(
chart_data,
x = 'col1',
y = ['col2', 'col3'],
color = ['#FF0000', '#0000FF'] # Optional
)