Forum Discussion

cartercjb's avatar
02-18-2022
Solved

Text Wrap in Bar Charts

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.

 

Any ideas on how to wrap the text?

-Carter

  • 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

4 Replies

Replies have been turned off for this discussion
  • harikm007's avatar
    harikm007
    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

  • Hi harikm007  - 

    That worked perfectly when viewing the widget in edit mode: 

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

     

    • cartercjb's avatar
      cartercjb
      ETL

      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's avatar
        harikm007
        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