Spaces:
Runtime error
Runtime error
Commit
β’
145deff
1
Parent(s):
006da70
Update app.py
Browse files
app.py
CHANGED
@@ -82,6 +82,10 @@ import altair as alt
|
|
82 |
import pandas as pd
|
83 |
import os
|
84 |
|
|
|
|
|
|
|
|
|
85 |
def progress_bar_chart() -> alt.Chart:
|
86 |
source_dataset, _ = obtain_source_target_datasets()
|
87 |
total_records = int(os.getenv("TARGET_RECORDS")) # The total goal of records.
|
@@ -112,18 +116,18 @@ def progress_bar_chart() -> alt.Chart:
|
|
112 |
text='text:N'
|
113 |
)
|
114 |
|
115 |
-
#
|
116 |
-
|
117 |
-
grid=False
|
118 |
-
).configure_view(
|
119 |
-
strokeWidth=0
|
120 |
-
).properties(
|
121 |
title='Progress Towards Goal',
|
122 |
width=800,
|
123 |
height=150
|
124 |
)
|
125 |
|
126 |
-
|
|
|
|
|
|
|
|
|
127 |
|
128 |
|
129 |
|
|
|
82 |
import pandas as pd
|
83 |
import os
|
84 |
|
85 |
+
import altair as alt
|
86 |
+
import pandas as pd
|
87 |
+
import os
|
88 |
+
|
89 |
def progress_bar_chart() -> alt.Chart:
|
90 |
source_dataset, _ = obtain_source_target_datasets()
|
91 |
total_records = int(os.getenv("TARGET_RECORDS")) # The total goal of records.
|
|
|
116 |
text='text:N'
|
117 |
)
|
118 |
|
119 |
+
# Combine the bar and the label into a layered chart.
|
120 |
+
chart = alt.layer(progress_bar, label_text).properties(
|
|
|
|
|
|
|
|
|
121 |
title='Progress Towards Goal',
|
122 |
width=800,
|
123 |
height=150
|
124 |
)
|
125 |
|
126 |
+
# Configure the whole chart instead of individual elements.
|
127 |
+
chart = chart.configure_axis(grid=False).configure_view(strokeWidth=0)
|
128 |
+
|
129 |
+
return chart
|
130 |
+
|
131 |
|
132 |
|
133 |
|