A chart with 1 or 0 in Y axis in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

A chart with 1 or 0 in Y axis in 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 () {//from  ww  w  . ja  v  a2 s .  c  o m
    $('#container').highcharts({
        xAxis: {
            type: 'datetime'
        },
        yAxis: {
            min:0,
            max:1,
            tickInterval: 1
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: [{
            type: 'line',
            step: true,
            data: [[Date.UTC(2014, 09, 10, 22, 50, 11), 0],
                  [Date.UTC(2014, 09, 11, 22, 50, 11), 1],
                   [Date.UTC(2014, 09, 12, 22, 50, 11), 0],
                  [Date.UTC(2014, 09, 13, 22, 50, 11), 1],
                  [Date.UTC(2014, 09, 14, 22, 50, 11), 1]]
        }]
    });
});

      </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