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'

})

185 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page