Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let objName = ["object1", "object2", "object3"];
- let xyzArr = ["xyz1", "xyz2","xyz3"];
- let theArr = [[], [], []];
- objName.forEach((name, index) => {
- window[name] = {
- xyz: xyzArr[index],
- arr: theArr[index]
- };
- });
- $.getJSON(json, result =>
- {result.forEach((elem, i, array) =>
- {object1.data.push({x:elem.val1, y:elem.val2});
- {object2.data.push({x:elem.val1, y:elem.val2});
- {object3.data.push({x:elem.val1, y:elem.val2});
- })
- });
- $.getJSON(json, result =>
- {result.forEach((elem, i, array) =>
- (for let j=0; j<=5; j++) {
- {object[i].data.push({x:elem.val1, y:elem.val2});
- )
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement