title: Setting data for Google Chart inside my JQuery Ajax Json parsing function?
body: <p>I have the following jquery function:</p>
  
  <pre><code>function doReport(query) {
     var rowArray = [];
     $.ajax({
          url: 'http://xxxxxxx' + query,
          dataType: 'json',
          success: function(data) {
              var sales = $('#salesDiv');
              sales.html('');
              for (res in data['sales']) {
                  sales.append('&lt;div&gt;' + data['sales'][res]['contractName'] + ' : $' + data['sales'][res]['salesAmount'] + '&lt;/br&gt;&lt;/div&gt;&lt;br /&gt;');
                  rowArray.push([data['sales'][res]['contractName'],data['sales'][res]['salesAmount']]);
                      alert("this works! "+rowArray[0]);
              }
          }
      });
      alert("this doesnt work "+rowArray[0]);
      drawChart(rowArray);
  </code></pre>
  
  <p>My question is in my first alert (this works!) i can see the value of rowArray.
  However in the second alert(this doesnt work), the values comes back as undefined.</p>
  
  <p>What am i doing wrong?  please help!
  I want to pass the values into my drawChart function and get my nice google pie chart to appear!</p>