set xAxis point Interval - Javascript highcharts

Javascript examples for highcharts:Chart Axis

Description

set xAxis point Interval

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>xAxis data</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">
    $(window).load(function(){/*  w  w  w  .  j a v  a2s  . com*/
$(function () {
    $('#container').highcharts({
        chart: {
        },
        xAxis: {
            tickInterval: 24 * 3600 * 1000,
            type: 'datetime',
             labels: {
                style: {
                    fontFamily: 'Tahoma'
                },
                rotation: -45
             }
        },
        series: [{
            data: [
                [Date.UTC(2010, 0, 1), 29.9],
                [Date.UTC(2010, 0, 2), 71.5],
                [Date.UTC(2010, 0, 3), 106.4],
                [Date.UTC(2010, 0, 4), 29.9],
                [Date.UTC(2010, 0, 5), 71.5],
                [Date.UTC(2010, 0, 6), 106.4],
                [Date.UTC(2010, 0, 7), 29.9],
                [Date.UTC(2010, 0, 8), 71.5],
                [Date.UTC(2010, 0, 9), 106.4],
                [Date.UTC(2010, 0, 10), 29.9],
                [Date.UTC(2010, 0, 11), 71.5],
                [Date.UTC(2010, 0, 12), 106.4],
                [Date.UTC(2010, 0, 13), 29.9],
                [Date.UTC(2010, 0, 14), 71.5],
                [Date.UTC(2010, 0, 15), 106.4],
                [Date.UTC(2010, 0, 16), 29.9],
                [Date.UTC(2010, 0, 17), 71.5],
                [Date.UTC(2010, 0, 18), 106.4],
                [Date.UTC(2010, 0, 19), 29.9],
                [Date.UTC(2010, 0, 20), 71.5],
                [Date.UTC(2010, 0, 21), 106.4],
                [Date.UTC(2010, 0, 22), 29.9],
                [Date.UTC(2010, 0, 23), 71.5],
                [Date.UTC(2010, 0, 24), 106.4],
                [Date.UTC(2010, 0, 25), 29.9],
                [Date.UTC(2010, 0, 26), 71.5],
                [Date.UTC(2010, 0, 27), 106.4],
                [Date.UTC(2010, 0, 28), 29.9],
                [Date.UTC(2010, 1, 1), 29.9],
                [Date.UTC(2010, 1, 2), 71.5],
                [Date.UTC(2010, 1, 3), 106.4],
                [Date.UTC(2010,1, 4), 29.9],
                [Date.UTC(2010, 1, 5), 71.5],
                [Date.UTC(2010, 1, 6), 106.4],
                [Date.UTC(2010, 1, 7), 29.9],
                [Date.UTC(2010, 1, 8), 71.5],
                [Date.UTC(2010, 1, 9), 106.4],
                [Date.UTC(2010, 1, 10), 29.9],
                [Date.UTC(2010, 1, 11), 71.5],
                [Date.UTC(2010, 1, 12), 106.4],
                [Date.UTC(2010, 1, 13), 29.9],
                [Date.UTC(2010, 1, 14), 71.5],
                [Date.UTC(2010, 1, 15), 106.4]
            ]
        }]
    });
});
    });

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

Related Tutorials