Update app.py
Browse files
app.py
CHANGED
@@ -187,7 +187,7 @@ def plot_graph_title(plot_df, stop, time):
|
|
187 |
#st.line_chart(plot_df)
|
188 |
# Create the Altair chart
|
189 |
chart = alt.Chart(plot_df).mark_line(point=True, interpolate="step-after").encode(
|
190 |
-
x=alt.X('stop_name:N', title="Stop name"), # Use column name as string
|
191 |
y=alt.Y('Occupancy:N', title="Vehicle Occupancy Status (Categories)", sort=category_order, scale=alt.Scale(domain=category_order)), # Treat Y as categorical
|
192 |
tooltip=["datetime", 'stop_name', 'Occupancy'] # Add tooltips for interactivity
|
193 |
).properties(
|
|
|
187 |
#st.line_chart(plot_df)
|
188 |
# Create the Altair chart
|
189 |
chart = alt.Chart(plot_df).mark_line(point=True, interpolate="step-after").encode(
|
190 |
+
x=alt.X('stop_name:N', title="Stop name", sort=plot_df["stop_name"]), # Use column name as string
|
191 |
y=alt.Y('Occupancy:N', title="Vehicle Occupancy Status (Categories)", sort=category_order, scale=alt.Scale(domain=category_order)), # Treat Y as categorical
|
192 |
tooltip=["datetime", 'stop_name', 'Occupancy'] # Add tooltips for interactivity
|
193 |
).properties(
|