line segments and data point in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

line segments and data point 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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {/*www  . jav  a 2 s.c  om*/
    var chart;
    $(document).ready(function () {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container'
            },
            //Code for the 'shared' tooltip in Highcharts, not required for HighStock
            tooltip: {
                crosshairs: true,
                shared: true
            },
            series: [{
                type: 'line',
                id: "main",
                data: [{
                    x: 0,
                    y: 0
                }, {
                    x: 1,
                    y: 1
                }, {
                    x: 2,
                    y: null
                }, {
                    x: 3,
                    y: 1
                }, {
                    x: 3.5,
                    y: null
                }, {
                    x: 4,
                    y: 0
                }]
            }]
        });
    });
});

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

Related Tutorials