Create line chart from two data series - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Create line chart from two data series

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 .  co  m
    $('#container1').highcharts({
        xAxis: {
            categories: ['May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'] // result from  query
        },
        legend: {
            enabled: false
        },
        series: [{
            id: 'someId',
            data: [ [0, 106.4], [1, 129.2], [3, 144.0]] // result from  query
        }, {
            id: 'someId2',
            data: [ [1, 148.5], [2, 216.4], [3, 194.1], [4, 95.6], [5, 54.4]] // result from  query
        }]
    });
});

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

Related Tutorials