cancel
Showing results for 
Search instead for 
Did you mean: 

Text Wrap in Bar Charts

cartercjb
10 - ETL
10 - ETL

I am trying to get the x-axis in the widget to wrap text. I originally thought that this Sisense Support KB (Labels & Legend Sorting In Stacked Charts) would resolve it but it didn't. One reason might be because their scenario is cutting off the text whereas my scenario it does not - it's just too long for my preference.

cartercjb_0-1645219387980.png

 

Any ideas on how to wrap the text?

-Carter

1 ACCEPTED SOLUTION

harikm007
13 - Data Warehouse
13 - Data Warehouse

@cartercjb ,

Margin of widget can be adjusted by using below script : 

widget.on('processresult', function(se, ev){	
	ev.result.chart.marginLeft = 150 //update this value based on your requirement
});

-Hari

View solution in original post

4 REPLIES 4

harikm007
13 - Data Warehouse
13 - Data Warehouse

@cartercjb ,

Margin of widget can be adjusted by using below script : 

widget.on('processresult', function(se, ev){	
	ev.result.chart.marginLeft = 150 //update this value based on your requirement
});

-Hari

cartercjb
10 - ETL
10 - ETL

Hi @harikm007  - 

That worked perfectly when viewing the widget in edit mode: 

cartercjb_0-1645456820944.png

 However, when I applied it and went back to the dashboard, this is the view I get: 

cartercjb_1-1645456839700.png

 

If I apply the script from the original KB I referenced, then it does work!   

Does your script also apply to Pie Chart labels? 
@harikm007 

harikm007
13 - Data Warehouse
13 - Data Warehouse

@cartercjb ,

Actually this script is simply adjusting the left margin. Sisense will adjust the text within the available space by itself. (If there is more margin, text will display in single line. If there is less margin, text will display in multiple lines)

-Hari