top of page

Display value labels inside bar

By default, in Column and Bar charts, all value labels are displayed outside bars. But here is a way to display values inside bar


Steps:

  1. Create bar/column chart. Make sure value label is enabled

  2. Add below script to the widget

  3. Save the script and refresh widget


widget.on('processresult',function(se,ev){
	
	ev.result.plotOptions.series.dataLabels.inside = true
	ev.result.plotOptions.series.dataLabels.align = 'right'
	ev.result.plotOptions.series.dataLabels.color = '#FFFFFF'

})

Here is a script to display both value label and category name inside bar




widget.on('processresult',function(se,ev){

	ev.result.xAxis.labels.align = 'left'
	ev.result.xAxis.labels.x = 5
	ev.result.xAxis.labels.style.color = '#FFFFFF'
	
	ev.result.plotOptions.series.dataLabels.inside = true
	ev.result.plotOptions.series.dataLabels.align = 'right'
	ev.result.plotOptions.series.dataLabels.color = '#FFFFFF'

})

148 views0 comments

Recent Posts

See All
bottom of page