Exact Legend Positioning
This widget script enables full control over the positioning of the legend within the widget.
Possible configuration values:
horizontalAlign: 'left', 'center', 'right'
verticalAlign: 'top', 'middle', 'bottom'
layout: 'horizontal', 'vertical', 'proximate'
(When "proximate" is chosen, the legend items will be placed as close as possible to the graphs they're representing, except in inverted charts or when the legend position doesn't allow it.)
x: positive number
y: positive number
Notes:
1) Horizontal positioning (horizontalAlign) can be further determined by the x option.
2) Vertical positioning (verticalAlign) can be further determined by the y option.
3) When the layout option is proximate, the verticalAlign option doesn't apply.
4) This script will only work with some of Sisense's widgets (only those based on Highcharts)
Code:
widget.on('processresult', function(se, ev) {
/********* Customize parameters *******/
var
horizontalAlign = 'left',
verticalAlign = 'top',
layout = 'horizontal',
x = 0,
y = 0;
/********* Do Not Change Code Below *******/
var legend = ev.result.legend;
legend.align = horizontalAlign;
legend.verticalAlign = verticalAlign;
legend.layout = layout;
legend.x = x;
legend.y = y;
});

Updated 03-02-2023
intapiuser
Admin
Joined December 15, 2022