Spaces:
Runtime error
Runtime error
update colors on pie chart
Browse files
app.py
CHANGED
|
@@ -108,7 +108,7 @@ def donut_chart_total() -> alt.Chart:
|
|
| 108 |
{
|
| 109 |
"values": [annotated_records, pending_records],
|
| 110 |
"category": [ANNOTATED, PENDING],
|
| 111 |
-
"colors": ["#
|
| 112 |
}
|
| 113 |
)
|
| 114 |
|
|
@@ -117,7 +117,7 @@ def donut_chart_total() -> alt.Chart:
|
|
| 117 |
radius=alt.Radius(
|
| 118 |
"values", scale=alt.Scale(type="sqrt", zero=True, rangeMin=20)
|
| 119 |
),
|
| 120 |
-
color=alt.Color("category:N", legend=alt.Legend(title=CATEGORY)),
|
| 121 |
)
|
| 122 |
|
| 123 |
c1 = base.mark_arc(innerRadius=20, stroke="#fff")
|
|
@@ -353,7 +353,7 @@ def main() -> None:
|
|
| 353 |
"markdown",
|
| 354 |
"number",
|
| 355 |
],
|
| 356 |
-
row_count=
|
| 357 |
col_count=(2, "fixed"),
|
| 358 |
interactive=False,
|
| 359 |
)
|
|
|
|
| 108 |
{
|
| 109 |
"values": [annotated_records, pending_records],
|
| 110 |
"category": [ANNOTATED, PENDING],
|
| 111 |
+
"colors": ["#27AE60", "#F1C40F"], # Green for Completed, Grey for Remaining
|
| 112 |
}
|
| 113 |
)
|
| 114 |
|
|
|
|
| 117 |
radius=alt.Radius(
|
| 118 |
"values", scale=alt.Scale(type="sqrt", zero=True, rangeMin=20)
|
| 119 |
),
|
| 120 |
+
color=alt.Color("category:N", range=source['colors'], legend=alt.Legend(title=CATEGORY)),
|
| 121 |
)
|
| 122 |
|
| 123 |
c1 = base.mark_arc(innerRadius=20, stroke="#fff")
|
|
|
|
| 353 |
"markdown",
|
| 354 |
"number",
|
| 355 |
],
|
| 356 |
+
row_count=10,
|
| 357 |
col_count=(2, "fixed"),
|
| 358 |
interactive=False,
|
| 359 |
)
|