title: How do i put dynamic values inside Highchart.js data?
body: <p>I am using codeigniter, I use below code to query dynamic values based on the selection in the dropdown box.</p>
  
  <pre><code>$("#month").change(function(){
      $.ajax({
          type : 'post',
          data : 'month='+ $(this).val() + '&amp;year='+$('#year').val(),
          url : '&lt;?php echo base_url()."index.php/suggestion/processReportBreakdown";?&gt;',
          success : function(data){
              $('#section').html(data); //&lt;---- i need to print html data
          }
      });
  });
  
  $("#year").change(function(){
      $.ajax({
          type : 'post',
          data : 'month='+ $(this).val() + '&amp;year='+$('#year').val(),
          url : '&lt;?php echo base_url()."index.php/suggestion/processReportBreakdown";?&gt;',
          success : function(data){
              $('#section').html(data);
          }
      });
  });
  </code></pre>
  
  <p>the processReportBreakdown() goes like this:</p>
  
  <pre><code>public function processReportBreakdown()
  {
      $month              = $this-&gt;input-&gt;post('month');
      $year               = $this-&gt;input-&gt;post('year');
      $data['query']  =   $this-&gt;suggestion-&gt;breakDownReport($month, $year);
  
      $data['totalBreakdown'] = $this-&gt;suggestion-&gt;getAllRowsBreakDownReport($month, $year);
      $total = $data['totalBreakdown']-1;
  
      $i = 0;
  
      foreach($data['query'] as $row)
      {
  
          if($i != $total)
          {
              echo "'".$row-&gt;countReport."',";
          }
          else
          {
              echo "'".$row-&gt;countReport."'";
          }
  
          $i++;
  
      }
  
  }
  </code></pre>
  
  <p>Now I want to get the response of ajax POST and print it inside highchart data... so that everytime that the dropdown changes, the chart also changes in accordance with the values being passed by ajax POST. What could be the proper way of doing this?</p>