question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Total" bar label for stacked bar chart

See original GitHub issue

Below is a screenshot of my stacked bar chart: screen shot 2017-01-23 at 2 47 57 pm

I would like to add a bold label to the end of each bar which would show the combined total of each section in that bar. Is there a way to do this currently? Thanks in advance!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

25reactions
xile611commented, Nov 7, 2017

Try the component <LabelList />.

15reactions
gennaroanesicommented, Mar 16, 2018

got it working with

{combinations.map((v, idx) => (
                <Bar
                  key={v}
                  dataKey={v}
                  name={formatKeyName(v)}
                  fill={getKeyColor(v)}
                  stackId="monthStack"
                >
                  {idx === combinations.length - 1 ?
                    <LabelList
                      position="top"
                      valueAccessor={entry => entry.D}
                      formatter={formatCurrencyValue}
                    /> : null}
                </Bar>
              ))}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add total labels to stacked column chart in Excel?
Add total labels to stacked column chart with an amazing tool ; 2. Select the stacked column chart, and click ; Kutools >...
Read more >
Add Total Values for Stacked Column and Stacked Bar Charts ...
In the “Select Data Label Range” pop up box, highlight the values from the “Grand Total” column · Change the “Label Position” to...
Read more >
How to Add Total Values to Stacked Bar Chart in Excel
Step 1: Enter the Data · Step 2: Calculate the Total Values · Step 3: Create Stacked Bar Chart · Step 4: Add...
Read more >
How to Add Labels to Show Totals in Stacked Column ...
8. In the chart, right-click the "Total" series and then, on the shortcut menu, select Add Data Labels.
Read more >
How to Add Totals to Stacked Charts for Readability
Learn how to make bar graphs easy to read in Excel by creating total amount labels on top of the stacked columns. Step-by-step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found