line chart tooltips setting - Javascript highcharts

Javascript examples for highcharts:Chart Tooltip

Description

line chart tooltips setting

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-git.js"></script> 
      <script type="text/javascript">
$(function () {/*from w  ww  .  jav a2  s .  c  om*/
    var chart;
    $(document).ready(function() {
        var ldlData = [[1178682831000,150], [1210305231000,140], [1241841231000,130], [1273377231000,120], [1304913231000,110], [1336535631000,100]];
        chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line'
        },
        tooltip: {
            formatter: function() {
                return this.y;
            }
        },
        series: [{
            data: ldlData
        }]
    });
    });
});

      </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: 400px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials