Spaces:
Running
Running
gauravlochab
commited on
Commit
·
f1dade8
1
Parent(s):
9428dec
feat: update combined time series graph to connect APR data points with consistent line color and improved legend handling
Browse files
app.py
CHANGED
@@ -615,18 +615,21 @@ def create_combined_time_series_graph(df):
|
|
615 |
)
|
616 |
)
|
617 |
|
618 |
-
# Add the
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
|
|
|
|
|
|
|
|
628 |
)
|
629 |
-
)
|
630 |
|
631 |
# Update layout - use simple boolean values everywhere
|
632 |
fig.update_layout(
|
|
|
615 |
)
|
616 |
)
|
617 |
|
618 |
+
# Add the line connecting APR data points
|
619 |
+
# MODIFIED: Make sure to use same color for line and marker and ensure line mode works
|
620 |
+
if not apr_data.empty:
|
621 |
+
fig.add_trace(
|
622 |
+
go.Scatter(
|
623 |
+
x=apr_data['timestamp'],
|
624 |
+
y=apr_data['apr'],
|
625 |
+
mode='lines',
|
626 |
+
line=dict(color='blue', width=2),
|
627 |
+
name=f'{agent_name} Line',
|
628 |
+
legendgroup=agent_name,
|
629 |
+
showlegend=False, # Don't show duplicate legend entries
|
630 |
+
hovertemplate='Time: %{x}<br>Value: %{y:.2f}<br>Agent: ' + agent_name + '<extra></extra>'
|
631 |
+
)
|
632 |
)
|
|
|
633 |
|
634 |
# Update layout - use simple boolean values everywhere
|
635 |
fig.update_layout(
|