Set axis type to category for line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Set axis type to category for line chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from ww  w  . j  av a2s .c o  m
Highcharts.chart('container', {
  title: {
    text: 'Chart with time'
  },
  xAxis: {
    type: 'category',
  },
  series: [{
    data: [
      ['Jan-1', 100],
      ['Jan-2', 120],
      ['Jan-3', 130]
    ]
  }]
});
    }

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/locale/af.js"></script> 
      <div id="container" style="height: 400px"></div>  
   </body>
</html>

Related Tutorials