Skip to content

histogram, animation_frame, hovertext has "sum of" #3983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hrani opened this issue Dec 15, 2022 · 1 comment
Closed

histogram, animation_frame, hovertext has "sum of" #3983

hrani opened this issue Dec 15, 2022 · 1 comment

Comments

@hrani
Copy link

hrani commented Dec 15, 2022

    @nicolaskruchten, thank you for the examples (https://github.com/plotly/plotly.py/issues/2876), I have made small modification to the same code added animation_frame,  before the play button is clicked yaxis and hovertext has no "sum of" text but once played we can see hovertext adds again sum of. 

Sorry I am new to this not sure if I am doing something stupid

import plotly.express as px
import pandas as pd
import io
data = '''
time name value
0 P1 2
10 P1 4
20 P1 6
30 P1 3
0 P2 1
10 P2 4
20 P2 3
30 P2 2
'''
df = pd.read_csv(io.StringIO(data), delim_whitespace=True)
fig = px.histogram(df, x="name", y="value",color='name',animation_frame="time",range_y=[0,df['value'].max()],color_discrete_sequence=px.colors.qualitative.T10)
fig.for_each_trace(lambda t: t.update(hovertemplate=t.hovertemplate.replace("sum of", "")))
fig.for_each_yaxis(lambda a: a.update(title_text=a.title.text.replace("sum of", "")))
fig.show()

Originally posted by @hrani in #2876 (comment)

@gvwilson
Copy link
Contributor

gvwilson commented Jul 5, 2024

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Alternatively, if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

@gvwilson gvwilson closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants