DrDomedag commited on
Commit
0212e2c
·
verified ·
1 Parent(s): 2d3ae25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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(