Skip to content

Commit d48ca34

Browse files
committed
Removed remaining titles in plots.
1 parent 57158b9 commit d48ca34

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

app/algo.py

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def number_of_tracked_reports_over_time(
9494
fig.update_layout(
9595
autosize=True,
9696
height=360,
97-
font_family="Roboto",
97+
font_family="Roboto, sans-serif",
9898
title=None,
9999
xaxis=dict(title=None, tickvals=data["year"].unique()),
100100
yaxis=dict(
@@ -176,20 +176,12 @@ def breakdown_of_reports_by_sector(df: pd.DataFrame) -> go.Figure:
176176
y="sector",
177177
x="percent",
178178
orientation="h", # Horizontal orientation
179-
title="Breakdown of Reports by Sector (All Years)",
180179
labels={"percent": "Percentage of Companies (%)", "sector": "Sector"},
181180
text="percent", # Show the percentage as text label
182-
hover_data={"unique_company_count": True, "percent": ":.2f%"},
183-
# Add tooltip for count and rounded percentage
181+
hover_data={"unique_company_count": True, "percent": ":.2f%"}, # Add tooltip for count and rounded percentage
184182
)
185183

186-
# Update layout to display the title above the chart
187-
fig.update_layout(
188-
title="Breakdown of Reports by Sector",
189-
title_x=0.5,
190-
title_y=0.9, # Adjust position
191-
title_font_size=20,
192-
) # Adjust font size
184+
fig.update_layout(title=None)
193185

194186
return go.Figure(fig)
195187

@@ -230,20 +222,14 @@ def breakdown_of_reports_by_hq_country(df: pd.DataFrame) -> go.Figure:
230222
y="upe_name",
231223
x="percent",
232224
orientation="h", # Horizontal orientation
233-
title="Breakdown of Reports by HQ Country over Time",
234225
labels={"percent": "Percentage of Companies (%)", "upe_name": "HQ Country"},
235226
text="percent", # Show the percentage as text label
236227
hover_data={"unique_company_count": True, "percent": ":.2f%"},
237228
# Add tooltip for count and rounded percentage
238229
)
239230

240231
# Update layout to display the title above the chart
241-
fig.update_layout(
242-
title="Breakdown of Reports by HQ Country over Time",
243-
title_x=0.5,
244-
title_y=0.95, # Adjust position
245-
title_font_size=20,
246-
) # Adjust font size
232+
fig.update_layout(title=None)
247233

248234
return go.Figure(fig)
249235

@@ -278,14 +264,16 @@ def breakdown_of_reports_by_sector_over_time(df: pd.DataFrame) -> go.Figure:
278264
x="year",
279265
y="unique_company_count",
280266
color="Sectors",
281-
title="Breakdown of Reports by Sector over Time",
282267
labels={"unique_company_count": "Number of Companies Reporting", "year": "Year"},
283268
barmode="stack",
284269
category_orders={"Sectors": chart_order},
285270
)
286271

287272
# Reverse the order of legend items
288-
fig.update_layout(legend=dict(traceorder="reversed"))
273+
fig.update_layout(
274+
title=None,
275+
legend=dict(traceorder="reversed")
276+
)
289277

290278
# Adjusting the legend order and formatting the legend labels
291279
for i, trace in enumerate(fig.data):
@@ -930,7 +918,7 @@ def tax_havens_use_evolution(df: pd.DataFrame, company: str) -> go.Figure:
930918

931919
# Update layout settings
932920
fig.update_layout(
933-
title="Tax havens use in profitables jurisdictions",
921+
title=None,
934922
xaxis_title=None,
935923
yaxis_title=None,
936924
yaxis_tickformat=".0%",

0 commit comments

Comments
 (0)