Create two line charts - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Create two line charts

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://code.jquery.com/jquery-compat-git.js"></script> 
      <script type="text/javascript">
$(function () {//from   ww  w  .j a v  a 2s.c  o  m
    Highcharts.chart('container', {
        chart: {
          marginBottom: 100,
          marginTop: 50
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        legend: {
          layout: 'vertical',
          maxHeight: 50,
        },
        series: [{
            data: [29.9, 71.5]
        }, {
            data: [144.0, 176.0]
        }, {
          data: [1,2,3,4]
        }, {
          data: [1,2,3,4]
        }]
    });
        Highcharts.chart('container2', {
        chart: {
          marginBottom: 100,
          marginTop: 50
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        legend: {
          layout: 'vertical',
          maxHeight: 50,
        },
        series: [{
            data: [29.9, 71.5]
        }]
    });
});

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

Related Tutorials