title: jqPlot and JSON formatted Data
body: <p>I'm returning a JSON string with an Ajax call in jQuery, I'd like to pump that data into a bar chart using jqPlot.  </p>
  
  <p>I got the JSON conversion code from another Stack-Overflow post, but can't understand why this isn't working.  My code:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      contentType: "application/json; charset=utf-8",
      data: JSON.stringify(DTO), //JSON.stringify(AnDParms), combined, 
      url: "GetAdmitsDischarges.asmx/GetAandD",
      dataType: "json",
      success: function (data) {
          //do chart stuff here.
          var line1 = [];
          for (var prop_name in data.d) {
              line1.push([prop_name, data[prop_name]])
          }
          var ticks = ['Admits', 'Discharges'];
  
          var plot1 = $.jqplot('chartdiv', [line1], {
              title: 'Admits &amp; Discharges',
              series: [{ renderer: $.jqplot.BarRenderer}],
              axesDefaults: {
                  tickRenderer: $.jqplot.CanvasAxisTickRenderer
              },
              axes: {
                  xaxis: {
                      renderer: $.jqplot.CategoryAxisRenderer
                  }
              }
          });
          //to prove the flow is working...
          //alert("Data: " + data.d);
  
      }, //end of success
      error: function (XMLHttpRequest, textStatus, errorThrown) {
          alert(textStatus + ' ' + errorThrown + ' ' + XMLHttpRequest);
      } //end of error
  });   //end of ajax call
  </code></pre>
  
  <p>In Firebug, the value of line1 is (going from 0 to 32): </p>
  
  <blockquote>
    <p>[["0", undefined],["1", undefined],...["31", undefined],["32",
    undefined]]</p>
  </blockquote>
  
  <p>While the value of data is: </p>
  
  <blockquote>
    <p>Object { d="{"Admits":"35","Discharges":"36"}" }</p>
  </blockquote>
  
  <p>Thanks for any help you can offer...</p>