provide option to display totals on top of each bar#5375
Conversation
|
I haven't yet been able to run the tests, probably a browser/configuration issue. Thus I haven't started on the jasmine tests. I can provide a few test cases if needed. |
archmoj
left a comment
There was a problem hiding this comment.
Thanks very much for the PR.
Before adding tests, I suggest you sync the master branch of fork with the latest changes of plotly/plotly.js/master; then git merge upstream/master into this branch.
Please find my other comments below:
| ].join(' ') | ||
| } | ||
| }, | ||
| displaytotal: { |
There was a problem hiding this comment.
displaytotal is too general while this attribute lives in layout.
How about barshowtotal?
There was a problem hiding this comment.
Much better indeed.
Should I also rename totaltemplate to bartotaltemplate, so that each bar specific option starts with bar ? Or do we want to reuse totaltemplate for area charts as well ?
|
Any update on this ? |
|
Thanks for this PR! Our team is currently working hard on finishing up the 2.0 release of Plotly.js which explains our radio-silence for the past while, and I apologize for not communicating more clearly about it. This PR should probably land in 2.1, which we expect to come out in April. I'm sorry for the long timelines here :) |
|
I am interested in using this feature. Any update? |
|
@nicolaskruchten Hello! I am interested in using this feature. Now that we're reaching April 2022 and plotly 2.11, are there any updates on this PR? |
|
@vovavili could you please fetch upstream/master and merge it into this branch? |
|
I am interested in using this feature. Any update? |
|
@nicolaskruchten @archmoj I've just merged upstream/master in this branch I personally have a weird result on my machine. However, as I have the same result when using any text with I'm still unable to run the jasmine tests on my machine. Hoping this can still make it to 2.13 |
|
Hi there is any update? |
| barshowtotal: { | ||
| valType: 'boolean', | ||
| dflt: false, | ||
| role: 'style', |
There was a problem hiding this comment.
There is no longer role needed for attributes like this one.
Please remove the role: 'style', line.
| totaltemplate: { | ||
| valType: 'string', | ||
| dflt: '%{total}', | ||
| role: 'style', |
There was a problem hiding this comment.
There is no longer role needed for attributes like this one.
Please remove the role: 'style', line.
| editType: 'plot', | ||
| description: 'Display the total value of each bar.' | ||
| }, | ||
| totaltemplate: { |
There was a problem hiding this comment.
We may want this attribute or a similar one to control hover.
It may be better to have
stackbartotal: {
texttemplate: ...,
hovertemplate: ...
}And there is no need for barshowtotal as it could be enabled by texttemplate.
|
Thanks @wilhelmhb for the great PR. |
|
October 2023, I could really use this feature. Thank you. |
|
@archmoj @alexcjohnson How is the review going? It would be really helpful to display totals for bar charts. |
|
Would you please fetch |
This PR aims at allowing users to display the total of each bar on top of it (bottom of it for negative values).
TODO: