Hey guys,
I would like to change the colors of my bars when I click on a specific color and so, set the selected bar as red and all the unselected ones as white; I didn’t find references about doing this, so I would appreciate a lot any help on changing it;
I have added a reproducible code that can be used
import plotly.express as px
import pandas as pd
df = pd.DataFrame({
"x": ["val1", "val2", "val3","val4", "val5", "val6"],
"y": [4,6,8,4, 7,7],
"fruit": ["apple", "apple", "orange", "orange", "orange", "apple"]
})
fig = px.bar(df, x="x", y="y", custom_data=["fruit"])
fig.update_layout(barmode="group", clickmode="event+select")
The wrong output:
Thank you very much in advance for any collaboration;
Regards,
Leonardo