File size: 854 Bytes
b819a69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import streamlit as st
import pandas as pd
import plotly.express as px


st.title("Dashboard Example")

uploaded_file = st.file_uploader("Upload CSV for Dashboard", type=["csv"])

if uploaded_file:
    data = pd.read_csv(uploaded_file)
    st.sidebar.title("Dashboard Controls")

    # Sidebar controls
    column = st.sidebar.selectbox("Select column to analyze:", data.columns)
    chart_type = st.sidebar.selectbox("Choose chart type:", ["Bar", "Line", "Scatter"])

    # Display summary
    st.write("Summary Statistics:")
    st.write(data.describe())

    # Generate chart
    if chart_type == "Bar":
        st.bar_chart(data[column])
    elif chart_type == "Line":
        st.line_chart(data[column])
    else:
        fig = px.scatter(data, x=data.index, y=column)
        st.plotly_chart(fig)