Hi there,
I am trying to display the percentage and also the count on this histogram hover label using this hovertemplate documentation, doesn’t seem to be working?
example label:
Percentage: 84%
Count: 5344
region_mirco_census_filtered_test = region_mirco_census[region_mirco_census['UK region'] == 'South East']
Region = go.Histogram(
x=region_mirco_census_filtered_test['Characteristic - Ethnicity'], histnorm='percent',
opacity=0.4, name="Region", hovertemplate = region_mirco_census['Characteristic - Ethnicity'].value_counts()
)
UK_average = go.Histogram(
x=region_mirco_census['Characteristic - Ethnicity'], histnorm='percent', marker=dict(color='rgba(0,0,0,0)', line=dict(width=2, color='red')),
opacity=0.6, name="UK average", hovertemplate = region_mirco_census['Characteristic - Ethnicity'].value_counts()
)
data = [Region, UK_average]
layout = go.Layout(barmode='overlay')
fig1 = go.Figure(data=data, layout=layout)
fig1.show()