by month for datetime chart - Javascript highcharts

Javascript examples for highcharts:Datetime Chart

Description

by month for datetime chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Support: stackoverflow</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function() {/* w  ww.  j av a 2s  . c o m*/
  $('#container').highcharts({
    xAxis: {
      type: 'datetime',
      labels: {
        formatter: function() {
          var temp = new Date(this.value);
          locale = "en-us",
            month = temp.toLocaleString(locale, {
              month: "long"
            });
          return month + '-' + temp.getFullYear();
        }
      }
    },
    series: [{
        data: [{
          name: "January",
          x: 1451624399999,
          y: 52
        }]
      }
    ]
  });
});

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

Related Tutorials