|
import streamlit as st |
|
import pandas as pd |
|
|
|
|
|
st.set_page_config(page_title="Power BI-like Dashboard", page_icon=":chart_with_upwards_trend:") |
|
|
|
|
|
uploaded_file = st.file_uploader("Choose a CSV file", type="csv") |
|
|
|
|
|
custom_styles = """ |
|
body { |
|
background-color: #f4f4f4; |
|
} |
|
.css-1k6zjxx { |
|
max-width: none; |
|
} |
|
""" |
|
|
|
|
|
st.markdown(f'<style>{custom_styles}</style>', unsafe_allow_html=True) |
|
|
|
if uploaded_file is not None: |
|
|
|
df = pd.read_csv(uploaded_file) |
|
|
|
|
|
st.subheader("Raw Data") |
|
st.dataframe(df, height=400) |
|
|
|
|
|
st.subheader("Basic Statistics") |
|
st.dataframe(df.describe(), height=200) |
|
|
|
|
|
selected_columns = st.multiselect("Select columns for analysis", df.columns) |
|
|
|
if selected_columns: |
|
|
|
st.subheader("Line Chart") |
|
st.line_chart(df[selected_columns], use_container_width=True) |
|
|
|
|
|
st.subheader("Bar Chart") |
|
st.bar_chart(df[selected_columns], use_container_width=True) |
|
|
|
|
|
st.subheader("Area Chart") |
|
st.area_chart(df[selected_columns], use_container_width=True) |
|
|
|
|
|
st.subheader("Interactive Table") |
|
st.dataframe(df[selected_columns], height=400) |