cancel
Showing results for 
Search instead for 
Did you mean: 

Script to hide specific values from chart

BIQ
8 - Cloud Apps
8 - Cloud Apps

I have a line chart with two metrics. I want to show the value of the first metric and hide the value of the second metric by default. Can someone help with a script to achieve this?

1 ACCEPTED SOLUTION

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @BIQ ,

If you are looking for a script to display value labels of only one matric, try this solution:

Disable the 'Value Label' option in design panel.

harikm007_0-1674559110507.png

 

And add below script to widget. (update the variable panelIndex with index panel whose values need to be displayed)

widget.on('processresult', function(se, ev){
	let panelIndex = 0 //index of panel whose labels should be displayed
	ev.result.series[0].dataLabels = {enabled:true}
});   

result:

harikm007_1-1674559216499.png

 

-Hari

 

View solution in original post

1 REPLY 1

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @BIQ ,

If you are looking for a script to display value labels of only one matric, try this solution:

Disable the 'Value Label' option in design panel.

harikm007_0-1674559110507.png

 

And add below script to widget. (update the variable panelIndex with index panel whose values need to be displayed)

widget.on('processresult', function(se, ev){
	let panelIndex = 0 //index of panel whose labels should be displayed
	ev.result.series[0].dataLabels = {enabled:true}
});   

result:

harikm007_1-1674559216499.png

 

-Hari