code looks like this:
meas_ids = list(set(df_dict.keys()))
meas_ids.sort()
meas_id = st.selectbox('Static Measurement Selection?',meas_ids)
df = df_dict[meas_id]
#if df is not None:
if st.button('Start') and df is not None:
df = self._set_index(df)
st.write(df)
cols = df.columns.values.tolist()
for col in [c for c in cols if c not in ['dn']]:
df_col = df[['dn', col]]
self._plot_samples(df_col, col)
def _plot_samples(self, df, col):
group = df.groupby(['dn'])
fig = go.Figure()
for k, v in group:
if max(v[col]) > 0:
name_str = str(k[0]) if isinstance(k, tuple) else k
fig = fig.add_trace(go.Scatter(x=v.index, y=v[col], name=name_str))
if fig.data:
st.write('**{}**'.format(col))
st.plotly_chart(fig)
Can you show how the plot looks in gray mode? I suspect it has something to do with plotting on the same figure object. Maybe clear the figure plotting once the selectionbox has changed?
then i select “B1” which should generate much more graphic and it shows below, not exactly gray, but uneditable, cleary should not be there, AvgCpuUsed is the first one, and it’s displayed below the staled graphic