showing x-axis label in lower configuration in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

showing x-axis label in lower configuration 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://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> 
      <style id="compiled-css" type="text/css">

#container {//from  www .  j a v  a  2s .  c o  m
   min-width: 310px;
   max-width: 800px;
   height: 400px;
   margin: 0 auto
}


      </style> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container"></div> 
      <script type="text/javascript">
$('#container').highcharts({
    chart: {
        type: 'spline',
        zoomType: 'x'
    },
    title: {
        text: 'CPS vs Time'
    },
    xAxis: {
        type: 'datetime',
        units: [
            [
                'second', [20, 40]
            ],
            [
                'minute', [1, 2, 5, 10, 15, 30]
            ],
            [
                'hour', [1, 2, 3, 5, 6, 8, 12]
            ],
            [
                'day', [1, 2]
            ],
            [
                'week', [1, 2]
            ],
            [
                'month', [1, 2, 3, 4, 6]
            ],
            [
                'year',
                null
            ]
        ],
        min: 1533876120000,
        max: 1533945599000
    },
    series: [{
        name: 'CC',
        data: [
            [1533876120000, 1],
            [1533876240000, 1],
            [1533876840000, 2],
            [1533876900000, 1],
            [1533877200000, 7],
            [1533877260000, 4],
            [1533877320000, 1]
        ]
    }]
});

      </script>  
   </body>
</html>

Related Tutorials