plot stacked columns and a single column together - Javascript highcharts

Javascript examples for highcharts:Column Chart

Description

plot stacked columns and a single column together

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {//from  ww  w .j  a  va  2  s .  c o m
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            categories: ['jack', 'jane', 'julie', 'john']
        },
        yAxis: [{
            title: {
                text: 'Grades'
            }
        }, {
            title: {
                text: 'Age'
            },
            opposite: true
        }],
        plotOptions: {
            column: {
                stacking: 'normal'
            }
        },
        series: [
        // first stack
        {
            data: [2, 1, 2, 3],
            stack: 0,
            yAxis: 0
        }, {
            data: [5, 4, 6, 6],
            stack: 0,
            yAxis: 0
        }, {
            data: [10, 9, 11, 10],
            stack: 0,
            yAxis: 0
        },
        // second stack
        {
            data: [18, 22, 17, 24],
            stack: 1,
            yAxis: 1
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container" style="height: 400px"></div>  
   </body>
</html>

Related Tutorials