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
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -615,18 +615,21 @@ def create_combined_time_series_graph(df):
615
  )
616
  )
617
 
618
- # Add the combined line AFTER markers for both APR and Performance
619
- fig.add_trace(
620
- go.Scatter(
621
- x=agent_data['timestamp'],
622
- y=agent_data['apr'],
623
- mode='lines',
624
- line=dict(color=color, width=2),
625
- name=f'{agent_name}',
626
- legendgroup=agent_name,
627
- hovertemplate='Time: %{x}<br>Value: %{y:.2f}<br>Agent: ' + agent_name + '<extra></extra>'
 
 
 
 
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(