top of page

Add both categories on the left side, if a bar chart contains two dimensions.

When we add 2 categories to a bar chart, one will display on left side and another will be on right side. We can use below script to display both categories on left side.



Step:

  1. Create a bar with 2 categories.

  2. Add below script to widget. Update the variable leftMargin based on length of category labels

  3. Save the script and refresh widget


widget.on('processresult',function(se,ev){
	var leftMargin = 200

	ev.result.chart.marginLeft= leftMargin
	ev.result.chart.marginRight= 50
		
	ev.result.plotOptions.series.borderWidth = 1;
	
	$.each(ev.result.xAxis.plotBands, function(index, value){
		value.label.align = 'left'
		value.label.x = -leftMargin + 10
	})
	
});

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
BI Next Level white logo

BI Next Level is your trusted resource for BI customization, data solutions, and expert insights. Explore practical tips, scripts, and tutorials for tools like Sisense, Python, and SQL. Let’s transform your data into impactful insights together.

Quick Links
Connect with us
Copyright © 2024. All Rights Reserved. Designed, Developed & Maintained  by Intertoons
bottom of page