divide line graph when there's a gap in the x axis for line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

divide line graph when there's a gap in the x axis 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" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function() {/* w  w  w .  j ava  2 s.  c  o  m*/
  $('#container').highcharts({
    chart: {
      type: 'spline'
    },
    title: {
      text: 'Test',
      x: -20
    },
    xAxis: {
      categories: ['23', '24', '25', '26', '27', '32', '33']
    },
    yAxis: {
      min: 0,
      max: 100
    },
    legend: {
      layout: 'vertical',
      align: 'right',
      verticalAlign: 'middle',
      borderWidth: 0
    },
    series: [{
      name: 'Value',
      data: [65, 76, 70.3, 79.3, null, 53.5, 77.7],
      color: "blue"
    }]
  });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials