tooltip showing on unsort data - Javascript highcharts

Javascript examples for highcharts:Chart Tooltip

Description

tooltip showing on unsort data

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.8.3.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from w ww . j a v  a2 s. co m
var data = [
    [5.875, -20],
    [8.1875, -30],
    [8.875, -40],
    [9.5, -50],
    [10.125, -60],
    [10.5, -70],
    [10.875, -80],
    [11.375, -90],
    [11.6875, -100],
    [11.875, -110],
    [12.0625, -120],
    [12.625, -130],
    [12.4375, -140],
    [12.625, -150],
    [12.5, -160],
    [12.4375, -170],
    [12.4375, -180],
    [12.375, -190],
    [12.25, -200],
    [12.1875, -210],
    [11.9375, -220],
    [11.625, -230],
    [11.5, -240],
    [11.125, -250],
    [10.75, -260],
    [10.625, -270]
]/*.sort(function(a, b) { return a[0]- b[0]}) */;
$('#container').highcharts({
    series: [{
        type: 'scatter',
        lineWidth: 1,
        data: data
    }]
});
    });

      </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="height: 400px; min-width: 600px"></div>  
   </body>
</html>

Related Tutorials