我想为我的多维数组添加一个维度,称为description
. 目标是遍历数组,计算子元素并根据存在的元素数量添加“父”维度description
。但我目前正试图将信息附加到我的数组中。我想添加这个“父”维度,或者至少能够将字符串放入 location description[x]["TimeSeries"]["parent"]
。有关如何进行的任何帮助?
(function () {
var description;
description = {
1: {
source: "http://beat.entrayn.com/render?width=550&from=-2hours&until=-&height=570&colorList=FFFFFF%2C%20BBBBBB&target=*.entraynec2_ldb01.load.load5&target=*.entraynec2_ldb01.load.load1&title=DB%20EC2%20Load&_uniq=0.9870549130719155&format=json",
TimeSeries: {
//parent: "#hero-three",
title: "Clients Installed"
}
},
2: {
source: "http://beat.entrayn.com/render?width=550&from=-2hours&until=-&height=570&colorList=FFFFFF%2C%20BBBBBB&target=*.entraynec2_ldb01.load.load5&target=*.entraynec2_ldb01.load.load1&title=DB%20EC2%20Load&_uniq=0.9870549130719155&format=json",
TimeSeries: {
//parent: '#g2-1'
}
},
3: {
source: "http://beat.entrayn.com/render?width=550&from=-2hours&until=-&height=570&colorList=FFFFFF%2C%20BBBBBB&target=*.entraynec2_ldb01.load.load5&target=*.entraynec2_ldb01.load.load1&title=DB%20EC2%20Load&_uniq=0.9870549130719155&format=json",
TimeSeries: {
//parent:
}
}
};
$(description[3]["TimeSeries"]["parent"]).append('g2-2');
var g = new Graphene;
g.build(description);
alert(description[3]["TimeSeries"]["parent"]);
}).call(this);