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

Add background image to a widget

Below script allow us to add background image to a widget.


Steps:

  1. Create a widget. (supported widget types : bar, column, area, line, pie, scatter)

  2. Add below script to widget and update then variable 'imageURL' with URL of image

  3. Save the script and refresh widget


widget.on('processresult', function(se, ev){
	
	imageURL = 'paste your image url here'
	
	//set background image
	ev.result.chart.plotBackgroundImage = imageURL 
	
	//set transparency to bars
	$.each(ev.result.series, function(index, value){
		value.borderWidth = 2
		value.borderColor = value.color
		value.borderRadius = 2
		
		value.color = Highcharts.color(value.color).setOpacity(0.6).get('rgba')
		
	})
})

13 views0 comments

Recent Posts

See All