updating chart type - Javascript highcharts

Javascript examples for highcharts:Chart Configuration

Description

updating chart type

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from   w  w w .  j  a v  a 2s  . c o m
var options = {
        chart: {
            type: 'line',
            renderTo: 'chart_example'
        },
        title: {
            text: 'Traffic'
        },
        xAxis: {
            categories: ['November', 'December', 'January']
        },
        yAxis: {
            title: {
                text: 'Views'
            }
        },
        series: [{
            name: 'Hello',
            data: [50, 30, 60]
        }]
    };
chart = new Highcharts.Chart(options);
options.chart.type = 'bar';
chart = new Highcharts.Chart(options);
    });

      </script> 
   </head> 
   <body> 
      <div id="chart_example"></div>  
   </body>
</html>

Related Tutorials