For any support or more customized script, contact us -  binextlevel@gmail.com

Add bands to Line Chart in Sisense

There can be scenarios where we need to understand in which level/band the value or category belongs to and the analysis will be easier if there is an option to add bands to the widget.


We can achieve this by adding below widget script


widget.on('ready', function(se, ev){
	$('svg .highcharts-plot-bands-labels-0', element).insertAfter('svg .highcharts-plot-bands-0', element)
})

widget.on('processresult', function(se, ev){
	
	ev.result.yAxis[0].plotBands = [{
			from:0,
			to:2500,
			color:'#9ffff6',
			label: {
					text: 'Low',
					style: {
						color: '#888a89'
					}
				}
		},
		{
			from:2501,
			to:5000,
			color:'#daf1ce',
			label: {
					text: 'Medium',
					style: {
						color: '#888a89'
					}
				}
		},
		{
			from:5001,
			to:7500,
			color:'#fff2c6',
			label: {
					text: 'High-1',
					style: {
						color: '#888a89'
					}
				}
			},
		{
			from:7501,
			to:15000,
			color:'#fcd9e2',
			label: {
					text: 'High-2',
					style: {
						color: '#888a89'
					}
				}
		},
		{
			from:15000,
			to:25000,
			color:'#f6cde3',
			label: {
					text: 'High-3',
					style: {
						color: '#888a89'
					}
				}
		}]
})

(Update from, to, color and text based on your requirement)



65 views0 comments

Recent Posts

See All