I have a bar chart, below is my code:
import plotly.express as px
fig = px.bar(states_with_most_killings, y='Number of Cases', x='State', text='Number of Cases',
template="none")
fig.update_traces(texttemplate='%{text:.2s}', textposition='outside', marker_color='grey')
fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')
fig.update_yaxes(showticklabels=False, showgrid=False)
fig.show()
So first I tried to have one bar with different color, but then I had to use go.Bar
, and it messed up all my settings, so Iām now trying to change the bar color when hovering. Is there any way? I have not found anything on the doc, not sure if I missed it.
Any inputs will be appreciated!