cancel
Showing results for 
Search instead for 
Did you mean: 

How to Remove a measure from a chart in sac script

thayumanavan
Participant
0 Kudos
148

Hi @N1kh1l 

add measure is working but remove measure is not working. Even i used remove member also, but when i change the list measure is not removed form the chart

if(ListBox_1.getSelectedKey()==="PickUnits")
{
Chart_25.setVisible(false);
 
 
Chart_25.addMeasure("ELTUIDCMP7",Feed.ValueAxis);
Chart_25.addMeasure("33558012-7484-4421-3006-224195070345",Feed.ValueAxis2);
 
Chart_25.removeMember(Feed.ValueAxis,"ELTUIDCMP2");
Chart_25.removeMember(Feed.ValueAxis2,"31948283-6646-4859-3131-200104570027");
 
Chart_25.removeMember(Feed.ValueAxis,"ELTUIDCMP3");
Chart_25.removeMember(Feed.ValueAxis2,"70672825-9386-4722-8931-171337372722");
 
 
}
 
if(ListBox_1.getSelectedKey()==="PickSLots")
{
 
 
Chart_25.addMeasure("ELTUIDCMP2",Feed.ValueAxis);
Chart_25.addMeasure("31948283-6646-4859-3131-200104570027",Feed.ValueAxis2);
 
Chart_25.removeMeasure("ELTUIDCMP7",Feed.ValueAxis);
Chart_25.removeMeasure("33558012-7484-4421-3006-224195070345",Feed.ValueAxis2);
 
 
Chart_25.removeMeasure("ELTUIDCMP3",Feed.ValueAxis);
Chart_25.removeMeasure("70672825-9386-4722-8931-171337372722",Feed.ValueAxis2);
 
//console.log(Chart_25);
}
 
Regards,
Thayu.

Accepted Solutions (1)

Accepted Solutions (1)

N1kh1l
Active Contributor

@thayumanavan 

Ok why don't you first try to read the measure from the chart and log it and see what is the format of the measure and then trying the same format in removeMeasure API.

console.log(Chart_25.getMeasures(Feed.ValueAxis)); // This should give you the format.

Just try below

var Measurelist =Chart_25.getMeasures(Feed.ValueAxis);

for(var i=0;i<Measurelist.length;i++)
{
Chart_25.removeMeasure(Measurelist[i], Feed.ValueAxis);
}

 

Nikhil

thayumanavan
Participant
0 Kudos
Hi @N1kh1l

Answers (0)