Spaces:
Sleeping
Sleeping
Commit
·
36445e1
1
Parent(s):
73f708b
Time series graph now using plotly in alerts view
Browse files- sections/alerts.py +9 -11
sections/alerts.py
CHANGED
|
@@ -178,18 +178,16 @@ else:
|
|
| 178 |
)
|
| 179 |
error_count.columns = [timestamp_col, "count"]
|
| 180 |
|
| 181 |
-
# Create the chart
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
)
|
| 190 |
-
.properties(width=700, height=300, title="Errors per hour")
|
| 191 |
)
|
| 192 |
-
st.
|
| 193 |
else:
|
| 194 |
st.success("No critical errors detected in the logs.")
|
| 195 |
|
|
|
|
| 178 |
)
|
| 179 |
error_count.columns = [timestamp_col, "count"]
|
| 180 |
|
| 181 |
+
# Create the chart with plotly
|
| 182 |
+
import plotly.express as px
|
| 183 |
+
|
| 184 |
+
fig = px.line(
|
| 185 |
+
error_count, x=timestamp_col, y="count", title="Errors per hour"
|
| 186 |
+
)
|
| 187 |
+
fig.update_layout(
|
| 188 |
+
xaxis_title="Time", yaxis_title="Number of errors", height=300
|
|
|
|
|
|
|
| 189 |
)
|
| 190 |
+
st.plotly_chart(fig, use_container_width=True)
|
| 191 |
else:
|
| 192 |
st.success("No critical errors detected in the logs.")
|
| 193 |
|