ralate2 commited on
Commit
1266ec7
·
verified ·
1 Parent(s): 017948d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -82,22 +82,18 @@ df['Original Issue Year'] = df['Original Issue Date'].dt.year
82
  # else:
83
  # st.write("No data available for the 'License Status' plot.")
84
 
85
- # Group data by License Status and State
86
- state_status_counts = df.groupby(['State', 'License Status']).size().reset_index(name='Count')
87
-
88
- # Visualization: Grouped Bar Chart
89
- st.subheader("License Status by State")
90
- chart_grouped = alt.Chart(state_status_counts).mark_bar().encode(
91
  x=alt.X('State:N', title='State'),
92
  y=alt.Y('Count:Q', title='Number of Licenses'),
93
- color=alt.Color('License Status:N', title='License Status', scale=alt.Scale(scheme='category20')),
94
- column=alt.Column('License Status:N', title='License Status')
95
  ).properties(
96
- width=100,
97
  height=400,
98
- title="License Status by State"
99
  )
100
- st.altair_chart(chart_grouped)
101
 
102
  # Write-up for Visualization 1
103
  st.write("""
 
82
  # else:
83
  # st.write("No data available for the 'License Status' plot.")
84
 
85
+ # Visualization: Stacked Bar Chart
86
+ st.subheader("License Status by State (Stacked)")
87
+ chart_stacked = alt.Chart(state_status_counts).mark_bar().encode(
 
 
 
88
  x=alt.X('State:N', title='State'),
89
  y=alt.Y('Count:Q', title='Number of Licenses'),
90
+ color=alt.Color('License Status:N', title='License Status', scale=alt.Scale(scheme='category20'))
 
91
  ).properties(
92
+ width=600,
93
  height=400,
94
+ title="License Status by State (Stacked)"
95
  )
96
+ st.altair_chart(chart_stacked)
97
 
98
  # Write-up for Visualization 1
99
  st.write("""