cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
The script below can be used to reduce the length of the labels in the bar chart to a specified length and add an ellipsis (if it reduced the length).
The script will reduce the length of the displayed names if it greater than specified varlength whether there is space in the chart or not. However, note that you will see the actual full description when you hover over the bar itself.
widget.on('beforeviewloaded', function (widget, ev) {
 
var newMaxCharactersPerLabel = 18;
ev.options.xAxis.labels.maxCharactersPerLabel = newMaxCharactersPerLabel;
ev.options.xAxis.labels.useHTML = true;
 
ev.options.xAxis.labels.formatter = function () {
 
// Change this to change the length of the substring
var lengthVar = 15;
 
var text = this.value;
var newText = '';
if (text.length <= lengthVar) {
newText = text;
}
else {
 newText = text.substring(0,lengthVar) + '...';
}
 
return newText;
}
});
Version history
Last update:
‎03-02-2023 09:18 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: