Spaces:
Sleeping
Sleeping
Update app.py
#35
by jfiel5 - opened
app.py
CHANGED
|
@@ -101,29 +101,12 @@ select_bar = alt.selection_point(
|
|
| 101 |
# .properties(width=500, height=800)
|
| 102 |
# )
|
| 103 |
|
| 104 |
-
bar_chart = (
|
| 105 |
-
alt.Chart(df_small)
|
| 106 |
-
.mark_bar()
|
| 107 |
-
.encode(
|
| 108 |
-
y=alt.Y("Agency:N", sort="-x"),
|
| 109 |
-
x=alt.X("mean(YTD Gross):Q", title="Average Personale Expense"), # <-- take the mean
|
| 110 |
-
tooltip=[
|
| 111 |
-
"Agency:N",
|
| 112 |
-
alt.Tooltip("mean(YTD Gross):Q", title="Avg YTD Gross", format="$,.0f")
|
| 113 |
-
],
|
| 114 |
-
color=alt.condition(select_bar, alt.value("#4C78A8"), alt.value("#CCCCCC"))
|
| 115 |
-
)
|
| 116 |
-
.add_params(select_bar)
|
| 117 |
-
.properties(width=500, height=800)
|
| 118 |
-
)
|
| 119 |
-
|
| 120 |
-
|
| 121 |
# bar_chart = (
|
| 122 |
# alt.Chart(df_small)
|
| 123 |
# .mark_bar()
|
| 124 |
# .encode(
|
| 125 |
# y=alt.Y("Agency:N", sort="-x"),
|
| 126 |
-
# x=alt.X("mean(YTD Gross):Q", title="
|
| 127 |
# tooltip=[
|
| 128 |
# "Agency:N",
|
| 129 |
# alt.Tooltip("mean(YTD Gross):Q", title="Avg YTD Gross", format="$,.0f")
|
|
@@ -132,6 +115,23 @@ bar_chart = (
|
|
| 132 |
# )
|
| 133 |
# .add_params(select_bar)
|
| 134 |
# .properties(width=500, height=800)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
)
|
| 136 |
|
| 137 |
# box = (
|
|
|
|
| 101 |
# .properties(width=500, height=800)
|
| 102 |
# )
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
# bar_chart = (
|
| 105 |
# alt.Chart(df_small)
|
| 106 |
# .mark_bar()
|
| 107 |
# .encode(
|
| 108 |
# y=alt.Y("Agency:N", sort="-x"),
|
| 109 |
+
# x=alt.X("mean(YTD Gross):Q", title="Average Personale Expense"), # <-- take the mean
|
| 110 |
# tooltip=[
|
| 111 |
# "Agency:N",
|
| 112 |
# alt.Tooltip("mean(YTD Gross):Q", title="Avg YTD Gross", format="$,.0f")
|
|
|
|
| 115 |
# )
|
| 116 |
# .add_params(select_bar)
|
| 117 |
# .properties(width=500, height=800)
|
| 118 |
+
# )
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
bar_chart = (
|
| 122 |
+
alt.Chart(df_small)
|
| 123 |
+
.mark_bar()
|
| 124 |
+
.encode(
|
| 125 |
+
y=alt.Y("Agency:N", sort="-x"),
|
| 126 |
+
x=alt.X("mean(YTD Gross):Q", title="Total Personale Expense"), # <-- take the mean
|
| 127 |
+
tooltip=[
|
| 128 |
+
"Agency:N",
|
| 129 |
+
alt.Tooltip("mean(YTD Gross):Q", title="Avg YTD Gross", format="$,.0f")
|
| 130 |
+
],
|
| 131 |
+
color=alt.condition(select_bar, alt.value("#4C78A8"), alt.value("#CCCCCC"))
|
| 132 |
+
)
|
| 133 |
+
.add_params(select_bar)
|
| 134 |
+
.properties(width=500, height=800)
|
| 135 |
)
|
| 136 |
|
| 137 |
# box = (
|