Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -85,10 +85,19 @@ def create_severity_violation_chart(df, age_group=None):
|
|
85 |
color_discrete_map=severity_colors, # --> for part 3
|
86 |
)
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
fig.update_layout(
|
89 |
xaxis_tickangle=-45,
|
90 |
legend_title='Severity Level',
|
91 |
-
barmode='stack'
|
|
|
|
|
92 |
)
|
93 |
|
94 |
# return fig
|
|
|
85 |
color_discrete_map=severity_colors, # --> for part 3
|
86 |
)
|
87 |
|
88 |
+
# fig.update_layout(
|
89 |
+
# xaxis_tickangle=-45,
|
90 |
+
# legend_title='Severity Level',
|
91 |
+
# barmode='stack'
|
92 |
+
# )
|
93 |
+
|
94 |
+
# modified the above code because x-axis labels were partially pruned
|
95 |
fig.update_layout(
|
96 |
xaxis_tickangle=-45,
|
97 |
legend_title='Severity Level',
|
98 |
+
barmode='stack',
|
99 |
+
margin=dict(t=50, b=150), # Increase bottom margin to avoid pruning
|
100 |
+
xaxis=dict(automargin=True)
|
101 |
)
|
102 |
|
103 |
# return fig
|