0

I'm using Highcharts to render some charts in a Custom Web Publishing solution using a Filemaker backend. In the process of just trying to draw out the charts I want, I'm creating a JSONish object by using data as such:

var vSeries = [ { "name": '2011 Q3', "data": [3316,468,475,398,244,466,358,328,380,199] }, { "name": '2011 Q4', "data": [3614,492,546,435,256,493,367,377,423,225] }, { "name": '2012 Q1', "data": [3891,544,579,489,266,512,414,384,464,239] }, { "name": '2012 Q2', "data": [3807,537,550,474,255,523,389,401,441,237] } ]; 

My question is how would I get the Maximum value of any of values in "data"(3891) using javascript? I'm sure it's some sort of loop but don't know the syntax to get the escape number for the iterations, as well as how to choose just the values in data.

Thanks for any guidance you can provide.

1
  • Oh, just FYI, there's no JSON here. JSON is pure text and does not have var declarations nor single quotes; your example is just a fragment of JavaScript code. Cheers. Commented May 23, 2012 at 3:53

1 Answer 1

3
Array.max = function( array ){ return Math.max.apply( Math, array ); }; 

See this link: http://ejohn.org/blog/fast-javascript-maxmin/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.