A line plot connects ordered values to make change easy to see. In a dashboard, it can show how sales, margin, or another metric progresses over time. section 6.1.3 section 6.5
A practical dashboard workflow is:
- Load the raw data and perform basic preparation, such as renaming columns. section 6.1.4
- Apply global filters and the selected date range before passing data to dashboard components. section 6.1.4
- Group, aggregate, and transform the filtered data into the series the plot should display. section 6.1.4
- Render the resulting visualization with Plotly and display it in Streamlit. section 6.5
Die-roll line plot
A small Streamlit app lets a user choose between 10 and 100 die rolls. After clicking Plot Graph, it generates random values from 1 to 6 and displays them as a line chart. section 1.3.5
Listing 1.2 A die roll simulator in Streamlit
import streamlit as st
import random
st.title("Die Roll Simulator")
num_rolls = st.slider('Number of die rolls', min_value=10, max_value=100)
if st.button('Plot Graph'):
die_rolls = [random.randint(1, 6) for _ in range(num_rolls)]
st.line_chart(data=die_rolls)
Inspect the compact Streamlit implementation of the die-roll example, including the slider, button, random data, and line-chart call. section 1.3.5





