Use same category name in X axis of line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Use same category name in X axis of 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"> 
      <style id="compiled-css" type="text/css">

#container {//from w  w w.  ja va  2 s.  co 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">
Highcharts.chart('container', {
    series: [{
        data: [{
            x: 0,
            y: 2,
            name: 'Jan'
        }, {
            x: 1,
            y: 3,
            name: 'Jan'
        }, {
            x: 2,
            y: 4,
            name: 'Jan'
        }]
    }],
    xAxis: {
        type: 'category',
        uniqueNames: false
    }
});

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

Related Tutorials