Bug fixed + specifitied for graphs
This commit is contained in:
parent
962882d1c2
commit
25393eb1be
@ -153,7 +153,11 @@ function processCSV(csv, filename) {
|
|||||||
} /* Use sequence for xAxis */
|
} /* Use sequence for xAxis */
|
||||||
} else {
|
} else {
|
||||||
xValues = Array.apply(null, Array(nlines)).map(function (_, i) {return i;});
|
xValues = Array.apply(null, Array(nlines)).map(function (_, i) {return i;});
|
||||||
graphs.xAxis = function (xa) { xa.axisLabel('').tickFormat(function(d) { return d3.format('d')(new Date(d)); }) };
|
graphs.xAxis = function (xa) {
|
||||||
|
xa.axisLabel('').tickFormat(function(d) {
|
||||||
|
return d3.format('d')(d);
|
||||||
|
})
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Then, populate the graphs object with the CSV values */
|
/* Then, populate the graphs object with the CSV values */
|
||||||
@ -183,15 +187,25 @@ function processCSV(csv, filename) {
|
|||||||
name = graphs[i].name;
|
name = graphs[i].name;
|
||||||
name = name.replace(/[&\/\\#,+()$~%.'":*?<>{}\s]/g,'_');
|
name = name.replace(/[&\/\\#,+()$~%.'":*?<>{}\s]/g,'_');
|
||||||
sfname = name + "_data";
|
sfname = name + "_data";
|
||||||
|
ofname = name + "_options";
|
||||||
gdfunction = undefined;
|
gdfunction = undefined;
|
||||||
|
options = {};
|
||||||
|
|
||||||
if (typeof window[sfname] == "function") {
|
if (typeof window[sfname] == "function") {
|
||||||
gdfunction = window[sfname];
|
gdfunction = window[sfname];
|
||||||
}
|
}
|
||||||
|
if (typeof window[ofname] == "function") {
|
||||||
|
options = window[ofname]();
|
||||||
|
}
|
||||||
for (j in graphs[i].d) {
|
for (j in graphs[i].d) {
|
||||||
if (gdfunction !== undefined) {
|
if (gdfunction !== undefined) {
|
||||||
graphs[i].d[j].values = gdfunction(graphs[i].d[j].values);
|
graphs[i].d[j].values = gdfunction(graphs[i].d[j].values);
|
||||||
}
|
}
|
||||||
|
if (options !== undefined) {
|
||||||
|
if (options.area === true) {
|
||||||
|
graphs[i].d[j].area = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
js/graph.js
12
js/graph.js
@ -12,6 +12,10 @@ function dsk_total_data(data) {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dsk_total_options() {
|
||||||
|
return { area: true };
|
||||||
|
}
|
||||||
|
|
||||||
function dsk_total_graph(graph) {
|
function dsk_total_graph(graph) {
|
||||||
graph.yAxis.axisLabel('Trafic (MB)').tickFormat(function(d) { return d3.format('.2f')(d); });
|
graph.yAxis.axisLabel('Trafic (MB)').tickFormat(function(d) { return d3.format('.2f')(d); });
|
||||||
}
|
}
|
||||||
@ -55,6 +59,10 @@ function net_total_graph(graph) {
|
|||||||
graph.yAxis.axisLabel('Trafic (MB)').tickFormat(function(d) { return d3.format('.2f')(d); });
|
graph.yAxis.axisLabel('Trafic (MB)').tickFormat(function(d) { return d3.format('.2f')(d); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function net_total_options() {
|
||||||
|
return { area: true };
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MongoDB
|
* MongoDB
|
||||||
*/
|
*/
|
||||||
@ -70,3 +78,7 @@ function mongodb_con_graph(graph) {
|
|||||||
function mongodb_mem_graph(graph) {
|
function mongodb_mem_graph(graph) {
|
||||||
graph.yAxis.axisLabel('Size (MB)').tickFormat(function(d) { return d3.format('d.0')(d); });
|
graph.yAxis.axisLabel('Size (MB)').tickFormat(function(d) { return d3.format('d.0')(d); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mongodb_mem_options() {
|
||||||
|
return { area: true };
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user