cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
When toggling the "value labels" switch of a widget's design pane, the labels are enabled or disabled for the entire chart.
In case you have multiple series and you want to disable just one of them (typical when it gets too crowded on the plot), it is possible to do by adding the following code to the widget's script:
/******* user configuration **********/
var seriesName = "MySeries";
/*************************************/
widget.on('processresult', function(sender, ev){
var data = _.find(ev.result.series, function (ser) {return ser.name == seriesName}).data
_.each(data, function(value){ 

      value.dataLabels = {enabled:false}
      })
})
Just replace the series name with the desired measure you want  to remove the labels from.
For hiding the value labels of multiple series, use the following script:
/******* user configuration **********/
var seriesNames = ["MySeries1", "MySeries2"];
/*************************************/
widget.on('processresult', function(sender, ev){
 seriesNames.forEach(function(e, i, a){
 var data = _.find(ev.result.series, function (ser) {return ser.name == e}).data
 _.each(data, function(value){ 
 value.dataLabels = {enabled:false}
 }) 
 })
})

BREAK-BY

In case your measure is "Broken By" some field, each series name will be as the specific value of that field. See this example, where only the "orange" labels are shown:
We enabled 'value labels' and configured in the script:
var seriesName = "apple";
The result:
 If you are using Markers signs which you would like to remove you can use the following script:
widget.on("beforeviewloaded",function(w,args){ 
var seriesToRemoveMarkerFrom = ["seriesName"]; 

var seriesWithoutMarkers = _.filter(args.options.series,function(ser){ 
return (seriesToRemoveMarkerFrom.indexOf(ser.name) > -1); 
}) 

if(seriesWithoutMarkers.length > 0){ 
seriesWithoutMarkers.forEach(function(s){ 
s.marker = {enabled : false}; 
}) 
}
Enjoy!
Comments
karengonzalez
7 - Data Storage
7 - Data Storage

Worked amazing! Thanks for sharing

Version history
Last update:
‎03-02-2023 09:12 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: