top of page

Button to Show/Hide value labels

Sometime the widget looks messy when we enable value labels. At the same time it would be good to enable it to analyze the chart easily. So let the end user enable to disable value labels as they required. Here is a script to add button to chart to show/hide value labels.


  1. Create new widget - (line/bar/column/pie/area chart)

  2. Add below script to widget

  3. Save the script and refresh widget

displayValue = false

widget.on('processresult', function(se, ev){	
	ev.result.chart.marginTop= 60
	ev.result.plotOptions.series.dataLabels.enabled = displayValue = displayValue

widget.on("domready", function(w, args){
	chart = w.chart[0][Object.keys(w.chart[0])[0]].hc
		displayValue == true?'Hide Values':'Show Values', 
		.on('click', function () {
			displayValue = !displayValue

It is possible to change style of buttons by adding 'style' property in the script

193 views0 comments

Recent Posts

See All


bottom of page