top of page

Display total value in legend - Bar/Column/Area/Line chart

A column chart splits the data by one or more dimensions and we have to manually sum up or create a separate widget to find total value of each dimensions.

The script below displays total value of each dimensions/items along with legend


  1. Create a bar/column/line/area chart

  2. Add below script to widget

  3. Save the script and refresh widget

widget.on('processresult', function(se, ev){
	ev.result.legend.labelFormatter = function(){
		legendSeries = ev.result.series.find(el=> ==
		totalValue = 0
		$.each(, function(index, value){
			totalValue = totalValue + value.y
		myItem = se.metadata.panels[1].items[0]
		myMask = $$get(myItem, "format.mask", {})

		var numberFormatter = prism.$injector.get('$filter')('numeric');
		formattesValue = numberFormatter(totalValue, myMask);
		return + '<span style="color:#838584; font-size:12.5px"> <b> (' + formattesValue + ')</b></span>'

207 views0 comments

Recent Posts

See All


bottom of page