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:
Create bar/column chart. Make sure value label is enabled
Add below script to the widget
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'
})
Comments