Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -494,7 +494,7 @@ if 'temuan_kode_distrik' in df_local.columns:
|
|
| 494 |
|
| 495 |
# 🔥 Tambahkan satu trace untuk setiap perusahaan agar muncul di legend
|
| 496 |
for i, (comp, ratio, color, angle) in enumerate(zip(companies, ratios, colors, angles)):
|
| 497 |
-
|
| 498 |
r=[ratio],
|
| 499 |
theta=[mid_angles[i]],
|
| 500 |
width=[angle],
|
|
@@ -502,10 +502,10 @@ if 'temuan_kode_distrik' in df_local.columns:
|
|
| 502 |
marker_line_color="white",
|
| 503 |
marker_line_width=1.2,
|
| 504 |
opacity=0.9,
|
| 505 |
-
hovertemplate="<b>%{text}</b><br>Avg Ratio: %{r
|
| 506 |
text=[comp],
|
| 507 |
-
name=comp,
|
| 508 |
-
showlegend=True
|
| 509 |
))
|
| 510 |
|
| 511 |
fig.update_layout(
|
|
|
|
| 494 |
|
| 495 |
# 🔥 Tambahkan satu trace untuk setiap perusahaan agar muncul di legend
|
| 496 |
for i, (comp, ratio, color, angle) in enumerate(zip(companies, ratios, colors, angles)):
|
| 497 |
+
fig.add_trace(go.Barpolar(
|
| 498 |
r=[ratio],
|
| 499 |
theta=[mid_angles[i]],
|
| 500 |
width=[angle],
|
|
|
|
| 502 |
marker_line_color="white",
|
| 503 |
marker_line_width=1.2,
|
| 504 |
opacity=0.9,
|
| 505 |
+
hovertemplate="<b>%{text}</b><br>Avg Ratio: %{r:.2f}<extra></extra>", # 🔥 Hapus [0]
|
| 506 |
text=[comp],
|
| 507 |
+
name=comp,
|
| 508 |
+
showlegend=True
|
| 509 |
))
|
| 510 |
|
| 511 |
fig.update_layout(
|