Create simplest bar chart - Javascript highcharts

Javascript examples for highcharts:Bar Chart

Description

Create simplest bar chart

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.10.1.js"></script> 
      <script type="text/javascript" src="ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> 
      <script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*  w w w. j  av a 2 s  . c  o  m*/
        $('#chart_panel').highcharts({
            chart: {
                type: 'bar'
            },
            title: {
                text: 'Fruit Consumption'
            },
            xAxis: {
                categories: ['Apples', 'Bananas', 'Oranges']
            },
            yAxis: {
                title: {
                    text: 'Fruit eaten'
                }
            },
            series: [{
                name: 'Jane',
                data: [1, 0, 4]
            }, {
                name: 'John',
                data: [5, 7, 3]
            }]
        });
    });

      </script> 
   </head> 
   <body> 
      <div class="panel panel-default"> 
         <div id="chart_panel" style="width:100%;height:314px"></div> 
      </div>  
   </body>
</html>

Related Tutorials