mathiassandnes commited on
Commit
9048554
·
1 Parent(s): b2744d8

Fix bar chart y-axis scaling (rangemode=tozero)

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -295,6 +295,7 @@ if selected_view == "Strategy":
295
  xaxis_title="Fleet Size",
296
  yaxis_title="Extra Profit from Circular Model (EUR)",
297
  showlegend=False,
 
298
  )
299
  st.plotly_chart(fig_advantage, use_container_width=True)
300
 
@@ -314,6 +315,7 @@ if selected_view == "Strategy":
314
  title="Products Needed to Serve Same Customers",
315
  xaxis_title="Fleet Size Target", yaxis_title="Products to Manufacture",
316
  barmode="group", legend=dict(orientation="h", yanchor="bottom", y=1.02),
 
317
  )
318
  st.plotly_chart(fig_products, use_container_width=True)
319
 
@@ -361,6 +363,7 @@ if selected_view == "Strategy":
361
  fig_sens.update_layout(
362
  title="Profit Advantage by # of Cycles",
363
  xaxis_title="Number of Use Cycles", yaxis_title="Profit Advantage (EUR)",
 
364
  )
365
  fig_sens.add_vline(x=max_cycles, line_dash="dash", line_color="blue",
366
  annotation_text=f"Current: {max_cycles}")
@@ -376,6 +379,7 @@ if selected_view == "Strategy":
376
  fig_cost.update_layout(
377
  title="Cost Savings from Reuse",
378
  xaxis_title="Number of Use Cycles", yaxis_title="Cost Saved vs Linear (EUR)",
 
379
  )
380
  st.plotly_chart(fig_cost, use_container_width=True)
381
 
 
295
  xaxis_title="Fleet Size",
296
  yaxis_title="Extra Profit from Circular Model (EUR)",
297
  showlegend=False,
298
+ yaxis=dict(rangemode='tozero'),
299
  )
300
  st.plotly_chart(fig_advantage, use_container_width=True)
301
 
 
315
  title="Products Needed to Serve Same Customers",
316
  xaxis_title="Fleet Size Target", yaxis_title="Products to Manufacture",
317
  barmode="group", legend=dict(orientation="h", yanchor="bottom", y=1.02),
318
+ yaxis=dict(rangemode='tozero'),
319
  )
320
  st.plotly_chart(fig_products, use_container_width=True)
321
 
 
363
  fig_sens.update_layout(
364
  title="Profit Advantage by # of Cycles",
365
  xaxis_title="Number of Use Cycles", yaxis_title="Profit Advantage (EUR)",
366
+ yaxis=dict(rangemode='tozero'),
367
  )
368
  fig_sens.add_vline(x=max_cycles, line_dash="dash", line_color="blue",
369
  annotation_text=f"Current: {max_cycles}")
 
379
  fig_cost.update_layout(
380
  title="Cost Savings from Reuse",
381
  xaxis_title="Number of Use Cycles", yaxis_title="Cost Saved vs Linear (EUR)",
382
+ yaxis=dict(rangemode='tozero'),
383
  )
384
  st.plotly_chart(fig_cost, use_container_width=True)
385