Skip to content

Commit

Permalink
cost graphs: move current selection marker down if costs are negative
Browse files Browse the repository at this point in the history
Fixes #234
  • Loading branch information
joAschauer committed Jun 3, 2024
1 parent 4da92e5 commit 506f004
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/plot_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,23 @@ def create_bar_chart_costs(

# add highlight for current selection:
if current_selection is not None and current_selection in res_costs.index:
if (res_costs["Total"] < 0).all():
y = 1.2 * min(res_costs["Total"])
ay = 30
else:
y = 1.2 * max(res_costs["Total"])
ay = -30

fig.add_annotation(
x=current_selection,
y=1.2 * max(res_costs["Total"]),
y=y,
text="current selection",
showarrow=True,
arrowhead=2,
arrowsize=1,
arrowwidth=2,
ax=0,
ay=-30,
ay=ay,
)

if output_unit is None:
Expand Down

0 comments on commit 506f004

Please sign in to comment.