Skip to content
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

Showing totals for stacked bar charts #85

Closed
tlrdstd opened this issue Dec 8, 2015 · 6 comments
Closed

Showing totals for stacked bar charts #85

tlrdstd opened this issue Dec 8, 2015 · 6 comments
Labels
feature something new

Comments

@tlrdstd
Copy link
Contributor

tlrdstd commented Dec 8, 2015

I've been trying to show totals on my stacked bar charts. I'd prefer to show them as an integral part of the graph, but I'd settle for hoverinfo if I had to.

This jsfiddle using annotations is the closest I've come: http://jsfiddle.net/u6f0q14n/3/

That works, until I click the legend to hide a given trace:

The annotations (totals) are left hanging in the air, and the graph does not nicely resize to the updated data. As best I can tell, the provided config options do not offer a pre-packaged way to solve this.

@etpinard etpinard added the feature something new label Jul 5, 2016
@PPPW
Copy link

PPPW commented Jul 13, 2017

I looked at #34, I wonder will it show total in 'markers+text' for stacked bar? It seems for me, if I specify 'text' for each series in stacked bar, then it will display text near each series, not sure is it possible to display a total number for all series, using 'markers+text'? Thanks!

@etpinard etpinard mentioned this issue Feb 10, 2019
6 tasks
@nicolaskruchten
Copy link
Contributor

nicolaskruchten commented Apr 11, 2019

I'd also like the ability to show totals in hovertemplates.

Perhaps we want a texttemplate ? (see #3816 )

@nicolaskruchten
Copy link
Contributor

this seems like a stack-level rather than trace-level thing. related to #3614 ?

@xmagor
Copy link

xmagor commented Sep 24, 2019

I had the same need, and maybe it's far to being the best solution, but it works, I used restyleData property like input in the callback, and additionaly put the figure of the plot like state, in this way, with de restyleData, detect when user interact with the figure. I save in a list the legends that are visible in the data figure, then, when define annotations only do it with the visibles legends.

Basically is recalculate all, but at least that happens in a short time lapse.

@archmoj archmoj self-assigned this Oct 26, 2019
@archmoj archmoj removed their assignment Jan 9, 2020
@sean-wallace
Copy link

This would be a great feature for stacked area charts too!

wilhelmhb added a commit to wilhelmhb/plotly.js that referenced this issue Jan 6, 2021
wilhelmhb added a commit to wilhelmhb/plotly.js that referenced this issue Jan 6, 2021
wilhelmhb added a commit to wilhelmhb/plotly.js that referenced this issue Jan 7, 2021
wilhelmhb added a commit to wilhelmhb/plotly.js that referenced this issue Jan 7, 2021
wilhelmhb added a commit to wilhelmhb/plotly.js that referenced this issue Jan 7, 2021
Rename option
Refactor code according to comments

Contributes to plotly#85
@gvwilson
Copy link
Contributor

gvwilson commented Jun 5, 2024

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

No branches or pull requests

8 participants