podi62
1
I'm trying to create a histogram like structure using the function below but can't get ti return any payload. Any ideas?
var Hy64={};
var arr[];
for (j=1;j<129; j+=2) {
Hy64.labels[j]=j; Hy64.labels[j+1]=j;
arr[j]=j-1;arr[j+1]=j;
}
Hy64.data[0]=arr;
Hy64.series = ['SINGLE'];
return {payload:Hy64};
E1cid
2
var arr[]
is a syntax error var arr = []
in your loop you are trying to add elements to data and labels, but neither have been defined.
var Hy64={labels:[],data:[]};
The loop starts at 1 and will produce element 0 as undefined.
podi62
3
Thank you so much. That solved my issue.
system
Closed
4
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.