Skip to content

Commit

Permalink
Merge pull request #72 from unicef-drp/average_line
Browse files Browse the repository at this point in the history
Increased help text
  • Loading branch information
Amy-Reidy authored Jul 3, 2024
2 parents 5a62879 + 3507578 commit eb262c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions dash_service/pages/transmonee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,11 @@ def get_base_layout(**kwargs):
"display": "inline-block",
"textAlign": "center",
"position": "relative",
"color":"white",
"color":"#562061",
"font-size": "16px",
"font-weight": "bold",
"text-decoration":"underline",
"text-decoration-color":"#562061",
"marginTop":"0px",
"marginBottom":"0px"
},
Expand All @@ -1227,7 +1231,7 @@ def get_base_layout(**kwargs):
"alignContent": "center",
"flexWrap": "wrap",
"paddingLeft": "5px",
"color":"white"
"color":"#562061"
},
),
dbc.Popover(
Expand Down Expand Up @@ -2386,6 +2390,7 @@ def download_data(n_clicks, data):
y="OBS_VALUE",
barmode="group",
text="OBS_VALUE",
category_orders={'Country_name': all_countries},
custom_data=[
"OBS_VALUE",
"Country_name",
Expand Down Expand Up @@ -2963,14 +2968,19 @@ def aio_area_figure(
)
chart_title = "<br>".join(chart_title)

# Define the desired order of countries
sorted_data = data.sort_values(by=['OBS_VALUE', 'Country_name'], ascending=[False, True])
country_order = sorted_data['Country_name'].tolist()

# set the layout to center the chart title and change its font size and color
layout = go.Layout(
title=chart_title,
title_x=0.5,
font=dict(family="Verdana", size=11),
legend=dict(x=1, y=0.5),
xaxis={
"categoryorder": "total descending",
"categoryorder": "array",
"categoryarray": country_order,
"tickangle": -45,
"tickmode": "linear",
"tickfont_size": 11,
Expand Down Expand Up @@ -3157,7 +3167,6 @@ def aio_area_figure(
graph_info = graph_info + "Zero values not showing on graph; see 'Countries with data' for more information."

if fig_type == "bar" and not dimension:
print(data.UNIT_MEASURE.values)
# Calculate the average of the 'Value' column
average_value = data["OBS_VALUE"].mean()

Expand Down
Binary file modified dash_service/static/indicator_dictionary_TM_v8.xlsx
Binary file not shown.

0 comments on commit eb262c4

Please sign in to comment.