jQuery Highcharts: change chart type using dropdown list
问题 i'm trying to change the value of chart as following <!doctype html> <head> <script> 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: [<?php foreach($chart as $`row) { echo $row['temp'].","; } ?>] }] }); }); </script> </head> <body>