title: Accessing min and max value within JSON array in JavaScript/HTML
body: <p>I have the following code that gets data from a database and plots a graph using HTML and the FusionCharts library. I'm just having some trouble with the graph formatting. I want the yAxisMin to be 10 values below the minimum value in the <code>data</code> array and the yAxisMax value to be 10 values above. </p>
  
  <pre><code>function createJSON(name, data){
      return(
          {
              "chart": {
                  "caption": String(name),
                  "subCaption": "15-Day Prices",
                  "xAxisName": "Day",
                  "yAxisName": "Price (USD)",
                  "anchorRadius": "1",
                  "showValues": "0",
                  "borderThickness": "3",
                  "yAxisMinValue": data.value.min() - 10,
                  "yAxisMaxValue": data.value.max() + 10,
                  "theme": "fint"
              },
              "data": data,
          }
      );
  }
  
  //I'm including this for context. This is the function that returns the data array
  var getHistory = function(req,res,next){
  
      var data = [];
      History.findOne({"Symbol": String(req.params.sym)}, function(err, foundHistory){
          if(foundHistory){
              (foundHistory.Historical).forEach(function(day){
                  data.push({
                      "label": day.Date,
                      "value": day.Close
                  });
              });
              res.json(createJSON(foundHistory.Name, data));
              next();
          }
          else{
              next();
          }
      }); 
  };
  
  
  module.exports = getHistory;
  </code></pre>
  
  <p>Everything else works fine. I just need help with the two lines of code:</p>
  
  <pre><code>"yAxisMinValue": data.value.min() - 10,
  "yAxisMaxValue": data.value.max() + 10,
  </code></pre>
  
  <p>How would I do this? This was my attempt but it does not compile.</p>