ZingChart: How do I display the stack totals on my stacked bar chart?

You can use value boxes and the %total token to display the total stacked value for each bar on your chart. You should place the valueBox object in the last series object so that the total stacked value appears once per bar. See the below chart.

plot: {
 	  valueBox: {
 	    text:"Stack Avg: %stack-average Stack Heigt: %stack-lengthStack Total: %stack-total",
 	    backgroundColor: 'black',
   	  rules: [
   	    {
   	      rule: '%stack-top == 0',
   	      visible: 0
   	    }
   	  ]
 	  }
 	}

Example: https://demos.zingchart.com/view/02322O1G

Documentation

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us