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
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn