Hi,
I need to surround a graph with a border, but couldn’t understand the documentation sample. Here is my code:
from itertools import groupby
from altair import Month
import streamlit as st
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
#st.set_page_config(initial_sidebar_state=“auto”, menu_items=None)
st.set_page_config(layout=‘wide’)
st.header(“This is my app”, divider=‘gray’)
df = pd.read_excel(‘manut_jan_apr24.xlsx’)
df = df.sort_values([‘Date’])
st.sidebar.title(“DATA FILTERS”)
month_options = [‘Whole period’] + list(df[‘Month’].unique())
month = st.sidebar.selectbox(“Month”, options=month_options, index=0,
placeholder=‘Select month…’, key=‘month’
)
col1, col2 = st.columns([3,2], gap=‘small’)
col3, col4, col5 = st.columns(3)
df1 = df.groupby([‘PlaceName’,‘Equipment’])[‘Dtstoped’].sum().reset_index()
df1 = df.groupby([‘PlaceName’,‘Equipment’])[‘Dtstoped’].sum()
df1 = df1.sort_values(ascending=False)
df1 = df1.groupby([‘PlaceName’]).head(1).reset_index()
df1 = df1[:10]
#========== How surround figures 1 and 2 bellow with borders??? ==================#
fig1 = go.Figure(go.Pie(labels=df1[‘PlaceName’] + ’ - ’ + df1[‘Equipment’], values=df1[‘Dtstoped’], hole=.6))
col1.plotly_chart(fig1, use_container_width=True)
fig2 = go.Figure()
fig2.add_trace(go.Indicator(mode=‘number’,
title = {“text”: f"Total Downtime Total - Unit#3
Hours
"},
value = df[‘Dtstoped’].sum()
))
col2.plotly_chart(fig2, use_container_width=True)
This is what I need:
Thank you for any help!