Hi all,
I have the following dataframe
publicationDate signingDate nif_contratante contratante ... contratada contract_date price reported
0 24-02-2020 04-02-2020 600081290.0 Agrupamento de Escolas de Porto de Mós ... The Irish College of English Limited 2020-02-04T00:00:00Z 7914 NaN
1 26-02-2020 13-02-2020 600000052.0 Instituto de Oftalmologia do Dr. Gama Pinto ... Instituto de Soldadura e Qualidade 2020-02-13T00:00:00Z 90 NaN
2 27-02-2020 27-02-2020 501442600.0 Instituto do Emprego e da Formação Profissiona... ... ASSOCIAÇÃO HUMANITÁRIA DOS BOMBEIROS VOLUNTÁRI... 2020-02-27T00:00:00Z 500 NaN
And the following code:
data = pd.read_csv('basecovid19_ad.csv')
chart3=px.bar(x=data['contract_date'], y=data['price'], color= data['price'],
range_x=['2020-03-01','2021-05-01'],
labels=dict(x="Data de Publicação", y="Valor (M€)", color="Valor em Euros",
custom_data=[data['contratante'], data['contratada']])
)
chart3.update_xaxes(title_font=dict(size=18, family='Lato', color='#1a1a1e'))
chart3.update_yaxes(title_font=dict(size=18, family='Lato', color='#1a1a1e'))
chart3.update_traces(
hovertemplate="<br>".join([
"DATA: %{x}",
"VALOR: %{y}",
"Entidade: {contratante}",
"Empresa: {contratada}",
])
)
chart3.show()
This is the result:
For some reason custom_data
is not pulling the values from the data
dataframe, or my script has some error that I’m not able to sort out.
Any help would be appreciated.
Thank you in advance!