dvilasuero HF staff commited on
Commit
145deff
β€’
1 Parent(s): 006da70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
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
- # Remove the unnecessary axis lines and ticks.
116
- progress_bar = progress_bar.configure_axis(
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
- return (progress_bar + label_text)
 
 
 
 
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