Spaces:
Running
on
Zero
Running
on
Zero
solves plotly display errors
Browse files
app.py
CHANGED
@@ -2063,22 +2063,23 @@ def make_prediction_enhanced(symbol: str, timeframe: str = "1d", prediction_days
|
|
2063 |
text=f'Enhanced Stock Prediction for {symbol}',
|
2064 |
x=0.5,
|
2065 |
xanchor='center',
|
2066 |
-
font=dict(size=
|
2067 |
-
y=0.
|
2068 |
),
|
2069 |
height=1000,
|
2070 |
showlegend=True,
|
2071 |
legend=dict(
|
2072 |
orientation="h",
|
2073 |
-
yanchor="
|
2074 |
-
y
|
2075 |
-
xanchor="
|
2076 |
-
x=
|
2077 |
-
bgcolor='rgba(255,255,255,0.
|
2078 |
bordercolor='black',
|
2079 |
-
borderwidth=1
|
|
|
2080 |
),
|
2081 |
-
margin=dict(t=120, b=
|
2082 |
autosize=True,
|
2083 |
hovermode='x unified'
|
2084 |
)
|
@@ -2111,9 +2112,9 @@ def make_prediction_enhanced(symbol: str, timeframe: str = "1d", prediction_days
|
|
2111 |
for i in range(len(fig.layout.annotations)):
|
2112 |
if i < 3:
|
2113 |
fig.layout.annotations[i].update(
|
2114 |
-
font=dict(size=
|
2115 |
-
y=fig.layout.annotations[i].y + 0.
|
2116 |
-
bgcolor='rgba(255,255,255,0.
|
2117 |
bordercolor='lightgray',
|
2118 |
borderwidth=1
|
2119 |
)
|
|
|
2063 |
text=f'Enhanced Stock Prediction for {symbol}',
|
2064 |
x=0.5,
|
2065 |
xanchor='center',
|
2066 |
+
font=dict(size=18, color='black'),
|
2067 |
+
y=0.95 # Moved down slightly to avoid overlap
|
2068 |
),
|
2069 |
height=1000,
|
2070 |
showlegend=True,
|
2071 |
legend=dict(
|
2072 |
orientation="h",
|
2073 |
+
yanchor="top",
|
2074 |
+
y=-0.15, # Position legend below all subplots
|
2075 |
+
xanchor="center",
|
2076 |
+
x=0.5, # Center the legend horizontally
|
2077 |
+
bgcolor='rgba(255,255,255,0.9)',
|
2078 |
bordercolor='black',
|
2079 |
+
borderwidth=1,
|
2080 |
+
font=dict(size=10) # Smaller font for better fit
|
2081 |
),
|
2082 |
+
margin=dict(t=120, b=150, l=80, r=80), # Increased bottom margin for legend
|
2083 |
autosize=True,
|
2084 |
hovermode='x unified'
|
2085 |
)
|
|
|
2112 |
for i in range(len(fig.layout.annotations)):
|
2113 |
if i < 3:
|
2114 |
fig.layout.annotations[i].update(
|
2115 |
+
font=dict(size=13, color='darkblue', family='Arial, sans-serif'),
|
2116 |
+
y=fig.layout.annotations[i].y + 0.01, # Reduced adjustment to prevent overlap
|
2117 |
+
bgcolor='rgba(255,255,255,0.9)',
|
2118 |
bordercolor='lightgray',
|
2119 |
borderwidth=1
|
2120 |
)
|