Hi work with plotly Go and plotly express.
I need legendgroups for my charts to update all similar if i click an value in the legend. So my current knowledge says that i cant use plotly express (correct me if I am wrong). So I have to use plotly GO, but with go there is no hoverdata? Sad that both together have all what I need.
I have an issue. I need Hoverdata on for e.g., but this doesnt work. I can use hoverdata with plotly express, but plotly express doesnt accept Legendgroup
*How to set Hover Data here?*
*How to set Legendgroup here?*
fig1bar = px.bar(dfbar1, x='Date',
title = "Title",
- for adding hover data to a
go trace you can use
customdata and a
hovertemplate, as described in https://plot.ly/python/hover-text-and-formatting/#adding-other-data-to-the-hover-with-customdata-and-a-hovertemplate
- you can update a
px figure using
fig.update_traces, for example
update_traces takes a
selector argument if you need to select only some traces)
I would recommend the 2nd method.
hi, thank you very much… so its also possible to create legendgroups without subplots? so sharing legends and select them parallel over multiple figures?
My problem is i have grouped data so if i use plotly express and i set legendgroup all traces of this chart appear or are gone…
I’m not sure I understand. You don’t need subplots to use legendgroup, see for example https://plot.ly/python/legend/#grouped-legend. Maybe you could share a standalone code to explain what you would like to do?
yes subplots working, thanks
Hi, I get the same issue! It seems you found the solution by using go and subplot. Did you also find a solution with plotly express?