title: jQuery Highcharts: change chart type using dropdown list
body: <p>i'm trying to change the value of chart as following </p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;head&gt;
  &lt;script&gt;
  var chart1; // globally available
  
  $(document).ready(function() {
      var chart = 'pie'
      $("select").change(function(){
          chart = $('#chart').val();
          alert(chart);
      });
  
     chart1 = new Highcharts.Chart({
         chart: {
            renderTo: 'container',
            type: chart 
          },
          yAxis: {
             title: {
                text: 'Temprature'
             }
          },
          series: [{
             name: 'mach_1',
              data: [&lt;?php 
              foreach($chart as $`row) {
              echo  $row['temp'].",";
              }
             ?&gt;]
            }]
        });
  });
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div id="form"&gt;
  
      &lt;label&gt;Select a chart : &lt;/label&gt;
      &lt;select id="chart"&gt;
        &lt;option&gt;pie&lt;/option&gt;
        &lt;option&gt;column&lt;/option&gt;
      &lt;/select&gt;
  
    &lt;/div&gt;
  
    &lt;div id="container"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i know this will change the value of chart on select, but it doesn't change the chart itself. Any ideas?</p>