top of page

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')
		
	})
})

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page