datetime Columns Using addPoint in column chart - Javascript highcharts

Javascript examples for highcharts:Column Chart

Description

datetime Columns Using addPoint in column 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://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
var d_t = [ 8,9,10,13].sort(function(a,b){return a-b;});
var cur = 0;/* ww w .j  a va 2 s  . co m*/
$(function () {
    $('#container').highcharts({
        chart: {
            type: "column"
        },
        series: [{
            data: [ ]
        }],
        xAxis: {
            type: "datetime"
        }
    });
    // the button action
    $('#button').click(function() {
        var chart = $('#container').highcharts();
        var msec = Date.UTC( 2013, 3, d_t[cur] );
        chart.series[0].addPoint( [msec, 10] );
        cur++;
        cur = ( cur >= 4 ) ? 3 : cur;
    });
});

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

Related Tutorials