Change width of columns or spacing between columns on bar/column chart.
AnsweredIs there any way i can adjust the width of columns using the Javascript API? I can't see anything immediately obvious.
Most searches just seem to bring up options of how to change the dashboard columns.
Any help is most appreciated, thanks.
Seem to have got it working in a pretty simple manner:
~~
widget.on('ready', function(se, ev){
$(element).find('.highcharts-series-group').find('rect').attr('width','45');
})
-
Thanks Nicolaus.
I've modified the script to shift the columns to the left as they widen to keep them in center.
Since the default width is 45, the left shift is the delta between 45 and the new size, divided by 2.
widget.on('ready', function(se, ev){
var w = 60;
var l = (w-45)/2;$(element).find('.highcharts-series-group').find('rect').each (function(){var x = $(this).attr('x'); $(this).attr('x',x-l); $(this).attr('width',w)})
})
Please sign in to leave a comment.
Comments
3 comments