cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
There might be cases where one needs to increase the height of the Y-Axis in a chart to ensure that the value labels are not removed while the chart is being responsive.  The following script allows you to increase the max Y-Axis value by an X percentage.
NOTE: The script assumes that the series is ordered in descending order and so takes the first value it gets from the list.
Increase the max value of YAxis to be 30% more than the Max Y Value
widget.on('processresult',function(widget, ev){
 
 var increasePercent = 0.3; // Change the value as needed
 var seriesNum = 0; // Change the value as needed
 
 var s = ev.result.series[seriesNum];
 
 if (!Array.isArray(s) || !s.length) {
 
 var maxYValue = s.data[0].y; // Get first data value since series is ordered in descending order
 
 ev.result.yAxis[0].max = maxYValue + increasePercent * maxYValue ;
 }

})
Version history
Last update:
‎03-02-2023 09:11 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]

Share this page: