title: HighCharts with CodeIgniter results nothing for MySQL fetched data
body: <p>I wanted to display data from database table in a bar chart. I used HighCharts library. The chart obviously loaded with default template data. But then I made some changes so that it can represent data from database. Although I think the flow of logic is correct, it doesn't show anything at all now. FYI: My knowledge on JSON and AJAX are nit very big.</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(document).ready(function() {  
  
  Highcharts.setOptions({
  colors: ['#e74c3c']
  });  
  
  $(function () {
  $('#container').highcharts({
      chart: {
          type: 'bar'
      },
      title: {
          text: 'Daily Income'
      },
      xAxis: {
          categories: ['2013-08-10', '2013-08-11', '2013-08-12']
      },
      yAxis: {
          title: {
              text: 'Daily Income From Banquet Reservations For Last 30 Days'
          }
      },
      series: &lt;?php echo $json; // echo encoded data ?&gt;
      }],
  });
  });
  
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;div id="container" style="width:100%; height:400px;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>    function bqt_daily_income() {
      $this-&gt;load-&gt;model('reports_model');
      $this-&gt;load-&gt;model('json_model'); // load model
  
      $report['query'] = $this-&gt;reports_model-&gt;bqt_daily_income();
      $table['income'] = $this-&gt;json_model-&gt;bqt_daily_income(); // fetch data from mysql database 
      $json['table'] = json_encode($table); // encode to json
      $data = array_merge($report, $json); // merge with other arrays as i also have a html table with raw data from database
  
      $role = $this-&gt;session-&gt;userdata('role');
      if ($role === 'admin') { $this-&gt;load-&gt;view('reports/bqt_daily_income_view', $data); } // load view with data array (merged)
      else if ($role === 'manager') { $this-&gt;load-&gt;view('error'); }
      else if ($role === 'user') { $this-&gt;load-&gt;view('error'); }
      else { $this-&gt;load-&gt;view('login');}
  }
  </code></pre>
  
  <p><strong>Model:</strong> (json_model)</p>
  
  <pre><code>function bqt_daily_income($json_data = array()) {
    $query = $this-&gt;db-&gt;query("SELECT DATE(time_stamp) AS day,  SUM(paid) AS income FROM payments WHERE type = 'Banquet Reservation' GROUP BY day ORDER BY time_stamp DESC LIMIT 30");
    if ($query-&gt;num_rows() &gt; 0) {
       foreach($query-&gt;result_array() as $row) {
       $json_data[$row['day']] = $row['income'];
       }
    }
    return $json_data;
  </code></pre>
  
  <p>}</p>