title: How to display the total value of a stacked bar chart in d3js
body: <p>I've made this <a href="https://plnkr.co/edit/ZjHBv3lQXcsGBvumdKWM?p=preview" rel="nofollow noreferrer">Plunkr</a> where I would like to display the total value of each bar, it's currently displaying the total accumulated value of each slice of the bar (the black text) and the total value at the end, I only want to display the total value shown at the end of each bar.</p>
  
  <p>I've commented out my attempt at this here</p>
  
  <pre><code>.text(function(d) {
                  if (d["x1_"+TEAM] != maxValue){
                      "display", "none"; 
                      } else { return formatText(d["x1_"+TEAM])
                      }
                  });
  </code></pre>
  
  <p>But the max value in <code>maxValue</code> is of course the max value of all bars combined.</p>
  
  <p>Is a similar solution possible or do I have to sort the data in a completely new function?</p>
  
  <p>Any help is appreciated!</p>