Skip to content

Commit

Permalink
fix legend color
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhou committed Jan 14, 2025
1 parent 7c0654a commit 24ca965
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/pages/0_Data inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,18 +299,18 @@ def count_true_values(df, time_period, column):
height=500,
bargap=0.05, # Gap between bars of adjacent locations
bargroupgap=0.1, # Gap between bars of the same location
barmode='group', # Grouped style
barmode="group", # Grouped style
showlegend=True,
title="Monthly counts",
legend=dict(
orientation="h", # Horizontal legend
y=-0.2, # Position below the plot
x=0.5, # Center the legend
xanchor="center", # Anchor the legend's x position
yanchor="top" # Anchor the legend's y position
yanchor="top", # Anchor the legend's y position
),
title="Monthly counts"
)

return fig

def app():
Expand Down
2 changes: 2 additions & 0 deletions code/util/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# For plotly styling
PLOTLY_FIG_DEFAULT = dict(
font_family="Arial",
legend_font_color='black',
)
PLOTLY_AXIS_DEFAULT = dict(
showline=True,
Expand Down Expand Up @@ -98,6 +99,7 @@ def override_plotly_theme(
color="black" # Font color
)

# Figure-level settings
fig.update_layout(
font_size=22 * font_size_scale,
hoverlabel_font_size=17 * font_size_scale,
Expand Down

0 comments on commit 24ca965

Please sign in to comment.