gxurxv commited on
Commit
0320d7b
·
verified ·
1 Parent(s): 0e05c2a

update y axis title spacing

Browse files
Files changed (1) hide show
  1. app.py +21 -7
app.py CHANGED
@@ -1173,7 +1173,7 @@ def create_combined_roi_time_series_graph(df):
1173
 
1174
  # IMPORTANT: Filter data by hardcoded date range (June 6 to July 8, 2025)
1175
  min_date = datetime(2025, 6, 6)
1176
- max_date = datetime(2025, 7, 17, 23, 59, 59) # Include all of July 8th
1177
  logger.info(f"Filtering ROI data to date range: {min_date} to {max_date}")
1178
 
1179
  # Count data points before filtering
@@ -1367,7 +1367,7 @@ def create_combined_roi_time_series_graph(df):
1367
 
1368
  # Update x-axis with better formatting and hardcoded date range (June 6 to July 8)
1369
  min_date = datetime(2025, 6, 6) # Hardcoded start date: June 6, 2025
1370
- max_date = datetime(2025, 7, 17) # Hardcoded end date: July 8, 2025
1371
  logger.info(f"ROI Graph - Hardcoded date range: min_date = {min_date}, max_date = {max_date}")
1372
  fig.update_xaxes(
1373
  showgrid=True,
@@ -1799,7 +1799,7 @@ def create_combined_time_series_graph(df):
1799
 
1800
  # IMPORTANT: Filter data by hardcoded date range (June 6 to July 8, 2025)
1801
  min_date = datetime(2025, 6, 6)
1802
- max_date = datetime(2025, 7, 17, 23, 59, 59) # Include all of July 8th
1803
  logger.info(f"Filtering APR data to date range: {min_date} to {max_date}")
1804
 
1805
  # Count data points before filtering
@@ -2089,13 +2089,27 @@ def create_combined_time_series_graph(df):
2089
  hovermode="closest"
2090
  )
2091
 
2092
- # Add single annotation for y-axis with proper spacing
 
2093
  fig.add_annotation(
2094
  x=-0.08, # Position further from the y-axis to avoid overlapping with tick labels
2095
- y=0, # Center of the y-axis
 
 
 
 
 
 
 
 
 
 
 
 
 
2096
  xref="paper",
2097
  yref="y",
2098
- text="Percent drawdown (%) Agent APR (%)",
2099
  showarrow=False,
2100
  font=dict(size=16, family="Arial, sans-serif", color="black", weight="bold"), # Adjusted font size
2101
  textangle=-90, # Rotate text to be vertical
@@ -2145,7 +2159,7 @@ def create_combined_time_series_graph(df):
2145
 
2146
  # Update x-axis with better formatting and hardcoded date range (June 6 to July 8)
2147
  min_date = datetime(2025, 6, 6) # Hardcoded start date: June 6, 2025
2148
- max_date = datetime(2025, 7, 17) # Hardcoded end date: July 8, 2025
2149
  logger.info(f"APR Graph - Hardcoded date range: min_date = {min_date}, max_date = {max_date}")
2150
  fig.update_xaxes(
2151
  showgrid=True,
 
1173
 
1174
  # IMPORTANT: Filter data by hardcoded date range (June 6 to July 8, 2025)
1175
  min_date = datetime(2025, 6, 6)
1176
+ max_date = datetime(2025, 7, 21, 23, 59, 59) # Include all of July 8th
1177
  logger.info(f"Filtering ROI data to date range: {min_date} to {max_date}")
1178
 
1179
  # Count data points before filtering
 
1367
 
1368
  # Update x-axis with better formatting and hardcoded date range (June 6 to July 8)
1369
  min_date = datetime(2025, 6, 6) # Hardcoded start date: June 6, 2025
1370
+ max_date = datetime(2025, 7, 21) # Hardcoded end date: July 8, 2025
1371
  logger.info(f"ROI Graph - Hardcoded date range: min_date = {min_date}, max_date = {max_date}")
1372
  fig.update_xaxes(
1373
  showgrid=True,
 
1799
 
1800
  # IMPORTANT: Filter data by hardcoded date range (June 6 to July 8, 2025)
1801
  min_date = datetime(2025, 6, 6)
1802
+ max_date = datetime(2025, 7, 21, 23, 59, 59) # Include all of July 8th
1803
  logger.info(f"Filtering APR data to date range: {min_date} to {max_date}")
1804
 
1805
  # Count data points before filtering
 
2089
  hovermode="closest"
2090
  )
2091
 
2092
+ # Add two separate annotations for y-axis titles
2093
+ # First annotation for "Percent drawdown (%)"
2094
  fig.add_annotation(
2095
  x=-0.08, # Position further from the y-axis to avoid overlapping with tick labels
2096
+ y=-25, # Position in the negative region
2097
+ xref="paper",
2098
+ yref="y",
2099
+ text="Percent drawdown (%)",
2100
+ showarrow=False,
2101
+ font=dict(size=16, family="Arial, sans-serif", color="black", weight="bold"), # Adjusted font size
2102
+ textangle=-90, # Rotate text to be vertical
2103
+ align="center"
2104
+ )
2105
+
2106
+ # Second annotation for "Agent APR (%)"
2107
+ fig.add_annotation(
2108
+ x=-0.08, # Position further from the y-axis to avoid overlapping with tick labels
2109
+ y=75, # Position in the positive region
2110
  xref="paper",
2111
  yref="y",
2112
+ text="Agent APR (%)",
2113
  showarrow=False,
2114
  font=dict(size=16, family="Arial, sans-serif", color="black", weight="bold"), # Adjusted font size
2115
  textangle=-90, # Rotate text to be vertical
 
2159
 
2160
  # Update x-axis with better formatting and hardcoded date range (June 6 to July 8)
2161
  min_date = datetime(2025, 6, 6) # Hardcoded start date: June 6, 2025
2162
+ max_date = datetime(2025, 7, 21) # Hardcoded end date: July 8, 2025
2163
  logger.info(f"APR Graph - Hardcoded date range: min_date = {min_date}, max_date = {max_date}")
2164
  fig.update_xaxes(
2165
  showgrid=True,