When working on a project, I encountered a problem of only taking the maximum and minimum values in the returned query content.
Firstly
/**
* Maximum value of array
* @param {Object} array
* @return {TypeName}
*/
Array.max=function(array)
{
return Math.max.apply(Math,array);
}
/**
* Array minimum value
* @param {Object} array
* @return {TypeName}
* /
Array.min=function(array)
{
return Math.min.apply(Math,array);
}
Call
//Processing vertical coordinate adaptation--start
var yData = data .rows[i];
var yMin = Array.min(yData);//Minimum value of ordinate
var yMax = Array.max(yData);//Maximum value of ordinate