def create_barchart(df, label, group, value, varv, varp):
# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])
df1 = df[df[group] == "No of deals"].reset_index(drop=True)[:]
total_volume = "{:,.0f}".format(df1[value].sum()).replace(",", " ")
var_volume = df1.loc[df1.index[-1], varv]
var_volume = "{:,.0f}".format(var_volume).replace(",", " ")
var_volume = f"+{var_volume}"
marker=dict(color="#33475b")
df2 = df[df[group] == "Amount"].reset_index(drop=True)[:]
total_value = "{:,.0f}".format(df2[value].sum()).replace(",", " ")
var_value = df2.loc[df2.index[-1], varv]
var_value = "{:,.0f}".format(var_value).replace(",", " ")
var_value = f"+{var_value}"
text=df2["VALUE_D"] + " K€",
marker=dict(color="#ff7a59")
title=f"<b>Hubspot - New deals created this year</b><br><span style='font-size: 14px;'>Total deals: {total_volume} ({total_value} K€) | This week: {var_volume} ({var_value} K€) vs last week</span>",
title_font=dict(family="Arial", size=20, color="black"),
xaxis_title_font=dict(family="Arial", size=11, color="black"),
title_text="No of deals",
title_font=dict(family="Arial", size=11, color="black"),
title_text="Amount in K€",
title_font=dict(family="Arial", size=11, color="black"),
# fig.update_xaxes(rangeslider_visible=True)
fig = create_barchart(df_trend, "LABEL", "GROUP", "VALUE", "VARV", "VARP")