Created
May 2, 2014 09:20
-
-
Save ESeufert/6aedcd73c9b1c2f7011e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getMaxObjectValue(metric, graph_metric) { | |
var values = []; | |
for (var i = 0; i < metric.length; i++) { | |
for (var k = 0; k < graph_metric.length; k++) { | |
if (parseFloat(metric[i][""+graph_metric[k]]) < 1) { | |
values.push(parseFloat(metric[i][""+graph_metric[k]])); | |
} else { | |
values.push(Math.ceil(parseFloat(metric[i][""+graph_metric[k]]))); | |
} | |
} | |
} | |
values.sort(function(a,b){return a-b}); | |
return values[values.length-1]; | |
} | |
function getMinObjectValue(metric, graph_metric) { | |
var values = []; | |
for (var i = 0; i < metric.length; i++) { | |
for (var k = 0; k < graph_metric.length; k++) { | |
if (parseFloat(metric[i][""+graph_metric[k]]) < 1) { | |
values.push(parseFloat(metric[i][""+graph_metric[k]])); | |
} else { | |
values.push(Math.floor(parseFloat(metric[i][""+graph_metric[k]]))); | |
} | |
} | |
} | |
values.sort(function(a,b){return a-b}); | |
return values[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment