Use time as series in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Use time as series in line chart

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  v a2  s .  c om
    $('#container').highcharts({
        chart: {
            zoomType: 'x'
        },
        xAxis: {
            type: 'datetime',
            tickInterval: 3600 * 1000,
            min: Date.UTC(2013,4,22),
            max: Date.UTC(2013,4,23),
        },
        series: [{
            data: [
                [1369206795000, 1],
                [1369225421000, 3],
                [1369230934000, 2]
            ],
            pointStart: Date.UTC(2012, 05, 22),
            pointInterval: 24 * 3600 * 1000 // one day
        }]
    });
});

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

Related Tutorials