Add step to line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Add step to 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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <style id="compiled-css" type="text/css">

body {/* ww  w .j a  va  2 s . c  o  m*/
   font-family: Arial, Verdana, sans-serif;
}


      </style> 
      <script type="text/javascript">
$(function () {
    $('#container').highcharts({
        title: {
            text: 'Step line types, with null values in the series'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        series: [{
            data: [1, 2, 3, 4, 5, 6, 7, 8, 9],
            step: 'right',
            name: 'Right'
        }, {
            data: [5, 6, 7, 8, 9, 10, 11, 12, 13],
            step: 'center',
            name: 'Center'
        }, {
            data: [9, 10, 11, 12, 13, 14, 15, 16, 17],
            step: 'left',
            name: 'Left'
        }]
    });
});

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

Related Tutorials