I’ve got all of the values for my data.setValue stored in an array. All the examples I find are as follow:
data.setValue(0,0,"Germany");
data.setValue(0,1,200);
I want to be able to loop through my array of values and pass them to data.setValue. I currently have something like this:
var finalCountries = []; <br>
finalCountries=[[Germany,200],[US,300],[Australia,400]];
for (var p=0; p < finalCountries.length; p++){
data.setValue(p,p,finalCountries[p][0]);
data.setValue(p,p+1,finalCountries[p][1]);
}
This is not working since its passing only the last value of the loop. Any help?
found the fix data.SetValue needs to always have (0,0) and then (0,1) as its initial values. I was using p that increases within the loop hence the miss match