title: Get stats and show it in chart - PHP/HighCharts
body: <p>I have a table called "tracks",it looks like this:</p>
  
  <ol>
  <li>id,</li>
  <li>name,</li>
  <li>url</li>
  <li>hits</li>
  </ol>
  
  <p>I have a pie charts, from highcharts, the code looks like this:</p>
  
  <pre><code> var chart;
  $(document).ready(function() {
     chart = new Highcharts.Chart({
        chart: {
           renderTo: 'chart',
           plotBackgroundColor: null,
           plotBorderWidth: null,
           plotShadow: false
        },
        title: {
           text: 'Where users came from, total'
        },
        tooltip: {
           formatter: function() {
              return '&lt;b&gt;'+ this.point.name +'&lt;/b&gt;: '+ this.percentage +' %';
           }
        },
        plotOptions: {
           pie: {
              allowPointSelect: true,
              cursor: 'pointer',
              dataLabels: {
                 enabled: false
              },
              showInLegend: true
           }
        },
        credits: {
          enabled: false
        },
         series: [{
           type: 'pie',
           name: 'Browser share',
           data: [
              ['Firefox.com',   45.0],
              ['Default.com',       26.8],
              ['MSN',       12.8],
              ['Google.com',    8.5],
              ['Yahoo.com',     6.2],
              ['Others',   0.7]
           ]
        }]
     });
  });
  </code></pre>
  
  <p>My question is, how can I get data from the "tracks" table (hits), and the (name) and output it in the pie chart like:</p>
  
  <p>'name','hits'</p>
  
  <p>And then, at last, convert # of hits, to %.</p>