So it appears that the question of removing or amending the ātitleā of a hover using unified hovermode has been asked multiple times without an answer on the plotly forum over the years:
And more than a few times on stackoverflow:
I am building a fairly complicated dashboard where this issue comes up in three separate places. I am inferring from the lack of a solution that this is just not currently possible. I am not super familiar with the plotly development process, but is there a way to request that this functionality be added?
I havenāt found anything in the documentation suggesting that the hovertemplate of a stacked x-unified bar chart canāt be customised in those ways, and something must be assembling it in that format, but what that may be doesnāt seem to be specified anywhere.
Completely undocumented, but while I was stepping through the plotly figure in dash I noticed that the default template takes the data passed in and create a hover template with <extra></extra>
tagged onto the end of the hovertemplate. If you add <extra></extra>
to the end of a traces hovertemplate it will not add the trace name into the āx unifiedā hover allowing you to do the following:
bar_graph_layout= "plotly express or plotly graph object"
for x in bar_graph_layout.data:
if x.name:
x.hovertemplate = "{name}:<br>Sometag: %{x}<br>Some otherinfo: %{y}<extra></extra>".replace('{name}',x.name)
If <extra></extra>
is not added the hovertemplate, the legend group or trace name will be applied around the hovertemplate in something you cannot edit, but if that html tag is in the hovertemplate it allows you the control the entire hover for each x unified
group.