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:
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.
Not to necro an old thread, but I again ran into this problem and wanted to check in ( 6 months later) to see if anyone had any ideas. The above solution, of adding the āextraā tags, involve modifications to the the ātrace names,ā circled in red below, not the tooltip title, circled in blue below.
Ideally, I would be able to replace the blue circled text, which is the y-axis tick name, with a combination of some static text and the value from another datapoint in the set. E.g., replace ā6thā with āTotal Tested: 87.ā
I know this seems minor, but as I mention in an earlier message, this issue actually pops up three times in this particular project of mine and Iād love to fix it if possible.