Spaces:
Sleeping
Sleeping
# π Show Filtered Data Table | |
st.subheader("π Pole Data Table") | |
st.dataframe(filtered_df) | |
# π Bar Chart - Power Generation | |
st.subheader("π Power Generation per Pole") | |
fig_bar = px.bar( | |
filtered_df, | |
x='Name', | |
y='Power_Generation__c', | |
color='Status__c', | |
labels={'Power_Generation__c': 'Power Generated (kWh)'}, | |
title="Power Output by Pole", | |
height=400 | |
) | |
st.plotly_chart(fig_bar, use_container_width=True) | |
# β οΈ Pie Chart - Fault Status Distribution | |
st.subheader("β οΈ Fault Status Distribution") | |
fault_data = filtered_df['Fault_Status__c'].value_counts().reset_index() | |
fault_data.columns = ['Fault Status', 'Count'] | |
fig_pie = px.pie( | |
fault_data, | |
names='Fault Status', | |
values='Count', | |
title="Fault Breakdown", | |
height=400 | |
) | |
st.plotly_chart(fig_pie, use_container_width=True) | |
# π Line Chart - Pole Installations Over Time | |
st.subheader("π Installation Trend") | |
install_trend = filtered_df.groupby(filtered_df['Installed_Date__c'].dt.to_period('M')).size() | |
install_trend.index = install_trend.index.to_timestamp() | |
fig_line_install = px.line( | |
x=install_trend.index, | |
y=install_trend.values, | |
labels={"x": "Month", "y": "Poles Installed"}, | |
title="Pole Installations Over Time", | |
markers=True | |
) | |
st.plotly_chart(fig_line_install, use_container_width=True) | |
# π οΈ Line Chart - Maintenance Activity | |
st.subheader("π οΈ Maintenance Trend") | |
maintenance_trend = filtered_df.groupby(filtered_df['Last_Maintenance_Date__c'].dt.to_period('M')).size() | |
maintenance_trend.index = maintenance_trend.index.to_timestamp() | |
fig_line_maint = px.line( | |
x=maintenance_trend.index, | |
y=maintenance_trend.values, | |
labels={"x": "Month", "y": "Maintenance Events"}, | |
title="Maintenance Activities Over Time", | |
markers=True | |
) | |
st.plotly_chart(fig_line_maint, use_container_width=True) | |