jfiel5 commited on
Commit
a3bf4a1
·
verified ·
1 Parent(s): 1f52e9e

with histo

Browse files
Files changed (1) hide show
  1. app.py +19 -9
app.py CHANGED
@@ -102,18 +102,28 @@ bar_chart = (
102
  )
103
 
104
 
105
- box = (
 
 
 
 
 
 
 
 
 
 
 
106
  alt.Chart(df_small)
107
- .mark_boxplot(size=40)
108
  .encode(
109
- x=alt.X("Agency:N", title=""),
110
- y=alt.Y("YTD Gross:Q", title="Salary Distribution"),
111
- opacity=alt.condition(select_bar,alt.value(1),alt.value(0)),
112
  color=alt.value("#4C78A8")
113
- )
114
- .properties(width=1000, height=800)
 
115
  )
116
 
117
-
118
- dashboard = bar_chart & box
119
  dashboard
 
102
  )
103
 
104
 
105
+ # box = (
106
+ # alt.Chart(df_small)
107
+ # .mark_boxplot(size=40)
108
+ # .encode(
109
+ # x=alt.X("Agency:N", title=""),
110
+ # y=alt.Y("YTD Gross:Q", title="Salary Distribution"),
111
+ # opacity=alt.condition(select_bar,alt.value(1),alt.value(0)),
112
+ # color=alt.value("#4C78A8")
113
+ # )
114
+ # .properties(width=1000, height=800)
115
+ # )
116
+ hist = (
117
  alt.Chart(df_small)
118
+ .mark_bar(opacity=0.7)
119
  .encode(
120
+ x=alt.X("YTD Gross:Q", bin=True, title="YTD Gross (binned)"),
121
+ y=alt.Y("count()", title="Count"),
 
122
  color=alt.value("#4C78A8")
123
+ )
124
+ .transform_filter(select_bar)
125
+ .properties(width=400, height=300)
126
  )
127
 
128
+ dashboard = bar_chart & hist
 
129
  dashboard