error in graph labels corrected

parent 003c73ad
...@@ -23,7 +23,13 @@ ...@@ -23,7 +23,13 @@
ticks = [], ticks = [],
counter = 1, counter = 1,
series = [], series = [],
options = {}; options = {},
key, data = {};
for (key in conf_data) {
if (conf_data.hasOwnProperty(key)) {
data[key] = [];
}
}
$.each( $.each(
output_data.elementList.sort( output_data.elementList.sort(
function (a, b) { function (a, b) {
...@@ -31,7 +37,7 @@ ...@@ -31,7 +37,7 @@
} }
), ),
function (idx, obj) { function (idx, obj) {
var reqKey, // ctrl_flag = false, var reqKey,
request, i; request, i;
// if the obj is of the requested family // if the obj is of the requested family
if (obj.family === config.family) { if (obj.family === config.family) {
...@@ -43,10 +49,7 @@ ...@@ -43,10 +49,7 @@
for (i = 0; i <= conf_data[reqKey].length-1; i += 1) { for (i = 0; i <= conf_data[reqKey].length-1; i += 1) {
request += getRequestedValue(obj, conf_data[reqKey][i]); request += getRequestedValue(obj, conf_data[reqKey][i]);
} }
series.push({ data[reqKey].push([counter, request]);
label: reqKey,
data: [[counter, request]]
});
} }
} }
ticks.push([counter, obj.id]); ticks.push([counter, obj.id]);
...@@ -63,6 +66,14 @@ ...@@ -63,6 +66,14 @@
); );
if (config.plot === "bars") { if (config.plot === "bars") {
for (key in data) {
if (data.hasOwnProperty(key)) {
series.push({
label: key,
data: data[key]
});
}
}
options = { options = {
xaxis: { xaxis: {
minTickSize: 1, minTickSize: 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment