Skip to content

Commit b2c622e

Browse files
Merge pull request #83 from CodeForPhilly/53-tooltip
#53 added tooltips to both charts, formatted to round to whole number…
2 parents ab88777 + a2006f4 commit b2c622e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def new_admissions_chart(projection_admits: pd.DataFrame, plot_projection_days:
303303
x=alt.X("day", title="Days from today"),
304304
y=alt.Y("value:Q", title="Daily admissions"),
305305
color="key:N",
306-
tooltip=["day", "key:N"]
306+
tooltip=["day", alt.Tooltip("value:Q", format='.0f', title="Admissions"), "key:N"]
307307
)
308308
.interactive()
309309
)
@@ -362,7 +362,7 @@ def admitted_patients_chart(census: pd.DataFrame) -> alt.Chart:
362362
x=alt.X("day", title="Days from today"),
363363
y=alt.Y("value:Q", title="Census"),
364364
color="key:N",
365-
tooltip=["day", "key:N"]
365+
tooltip=["day", alt.Tooltip("value:Q", format='.0f', title="Census"), "key:N"]
366366
)
367367
.interactive()
368368
)

0 commit comments

Comments
 (0)