title: Passing data from $ajax call to highcharts
body: <p>I have an ajax call</p>
  
  <pre><code>$(function () {
      $.ajax({
          url: '../../getdaily.php',
          type:'POST',
          dataType: '',
          success: function(output_string){
             console.log(output_string);
          },
          error: function (xhr, ajaxOptions, thrownError){
              console.log(xhr.statusText);
              console.log(thrownError);
          }
      });
  });
  </code></pre>
  
  <p>and the console.log will output...</p>
  
  <pre><code>[{"name":"Test-Cases","y":118},{"name":"White-Box","y":43},{"name":"Priority","y":44}]
  </code></pre>
  
  <p>I can easily paste this into my <code>data :</code> for highcharts and get the piechart I am looking for like so</p>
  
  <pre><code>...
  series: [{
          type: 'pie',
          name: 'Browser share',
          data: [{"name":"Test-Cases","y":118},{"name":"White-Box","y":43},{"name":"Priority","y":44}]
      }]
  ...
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/YPzEH.jpg" alt="enter image description here"></p>
  
  <p>My question is how do I get the <code>output_string</code> into the Highcharts <code>data : &lt;here&gt;</code>. I have tried various ways of passing in as a variable and starting to spin out on this, not sure why.</p>
  
  <p>The actual code I am using for highcharts and passing into an id...</p>
  
  <pre><code>$('#container').highcharts({
      chart: {
          plotBackgroundColor: null,
          plotBorderWidth: null,
          plotShadow: false
      },
      title: {
          text: 'Browser market shares at a specific website, 2014'
      },
      tooltip: {
          pointFormat: '{series.name}: &lt;b&gt;{point.percentage:.1f}%&lt;/b&gt;'
      },
      plotOptions: {
          pie: {
              allowPointSelect: true,
              cursor: 'pointer',
              dataLabels: {
                  enabled: true,
                  format: '&lt;b&gt;{point.name}&lt;/b&gt;: {point.percentage:.1f} %',
                  style: {
                      color: (Highcharts.theme &amp;&amp; Highcharts.theme.contrastTextColor) || 'black'
                  }
              }
          }
      },
      series: [{
          type: 'pie',
          name: 'Browser share',
          data: [{"name":"Test-Cases","y":118},{"name":"White-Box","y":43},{"name":"Priority","y":44}]
      }]
  });
  </code></pre>
  
  <p>And to cover the php file, here is a partial of the end</p>
  
  <pre><code>...
  $mysqli-&gt;real_query("SELECT priority FROM daily");
  $rows2 = array();
  $numb2 = 0;
  $res2 = $mysqli-&gt;use_result();
  $rows2['name'] = 'Priority';
  while($r2 = $res2-&gt;fetch_assoc()) {
     $numb2+= $r2['priority'];
     $rows2['y'] = $numb2;
  }
  
  $result = array();
  array_push($result,$rows);
  array_push($result,$rows1);
  array_push($result,$rows2);
  
  echo json_encode($result);
  </code></pre>