Use timestamp as data series - Javascript highcharts

Javascript examples for highcharts:Chart Series

Description

Use timestamp as 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() {/*w  ww .ja  v a 2 s.c  o  m*/
  $('#container').highcharts({
    series: [{
      "name": "avg_sales",
      "color": "#3b6982",
      "data": [{
            "name": "point's name",
          "x": 1230768000,
          "y": 526.42
        }, {
          "x": 1230854400,
          "y": 1850.3
        }, {
          "x": 1230940800,
          "y": 3199.786
        }]
    }],
    tooltip: {
      dateTimeLabelFormats: {
        hour: '%A, %b %e, %l %p'
      },
    },
    xAxis: {
      dateTimeLabelFormats: {
        hour: '%l %p'
      },
      type: 'datetime'
    },
  });
});

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

Related Tutorials