bar chart set up - Javascript highcharts

Javascript examples for highcharts:Bar Chart

Description

bar chart set up

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div> 
      <script type="text/javascript">
 var myChart = Highcharts.chart('container', {
                chart: {//w w w. ja va2s .co m
                    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, 19]
                }]
            });

      </script>  
   </body>
</html>

Related Tutorials