Horizontal stacked bar chart: add a Total
Solved
hardgratte
Posted messages
482
Status
Membre
-
hardgratte Posted messages 482 Status Membre -
hardgratte Posted messages 482 Status Membre -
Hello,
I am building a stacked horizontal bar chart, and I need to display the total for each bar.
In the attached image, I added a "Total" bar in black to show the value (the label of the bar; the values come from the associated table). My first idea was to make this bar transparent and that would be it.
But when I do that, the width of the chart window stays the same and does not adjust to the visible chart (without the hidden Total bars). I get a large chart that is half empty.
I wanted to use a combination chart (by assigning my Total values to a Line or Scatter type), but I understand that this option is very limited with this type of chart (stacked horizontal bars).
I have scratched my head in every direction, but I haven't found a solution.
I am counting on you, thank you in advance for your suggestions.
Configuration: Windows / Chrome 101.0.4951.64
I am building a stacked horizontal bar chart, and I need to display the total for each bar.
In the attached image, I added a "Total" bar in black to show the value (the label of the bar; the values come from the associated table). My first idea was to make this bar transparent and that would be it.
But when I do that, the width of the chart window stays the same and does not adjust to the visible chart (without the hidden Total bars). I get a large chart that is half empty.
I wanted to use a combination chart (by assigning my Total values to a Line or Scatter type), but I understand that this option is very limited with this type of chart (stacked horizontal bars).
I have scratched my head in every direction, but I haven't found a solution.
I am counting on you, thank you in advance for your suggestions.
Configuration: Windows / Chrome 101.0.4951.64
3 réponses
Hello,
Another solution, although a bit cumbersome: add a text box at the end of each bar and enter the text =Sheet1!$B$2 in the formula bar. $B$3, $B$4... for the other bars.
Alternatively, you can add a series =0 and change the label 0 to =Sheet1!$B$2. (B3, B4, etc.)
This alternative is simplified for those who have already installed XY chart labels.
Another solution, although a bit cumbersome: add a text box at the end of each bar and enter the text =Sheet1!$B$2 in the formula bar. $B$3, $B$4... for the other bars.
Alternatively, you can add a series =0 and change the label 0 to =Sheet1!$B$2. (B3, B4, etc.)
This alternative is simplified for those who have already installed XY chart labels.
Hello
An idea
Take the total range as x-axis labels
https://www.cjoint.com/c/LErony8MgSB
Best regards
An idea
Take the total range as x-axis labels
https://www.cjoint.com/c/LErony8MgSB
Best regards
It could have worked too, but my labels on the Y-axis are very long and cannot be oriented vertically (and it's not possible to orient them otherwise when selecting multiple labels, see a previous post: https://forums.commentcamarche.net/forum/affich-37592908-graphique-barres-empilees-orientation-des-etiquettes#p37594887)
Thanks anyway :)
Thanks anyway :)
I finally did the second variant (I needed it to remain automated) and it works quite well.
Thank you for the suggestion :)