set up tooltip for stock chart - Javascript highcharts

Javascript examples for highcharts:Chart Tooltip

Description

set up tooltip for stock 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"> 
   </head> 
   <body> 
      <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> 
      <script src="https://code.highcharts.com/stock/modules/export-data.js"></script> 
      <div id="container" style="height: 400px; min-width: 310px"></div> 
      <script type="text/javascript">
$.getJSON('https://www.highcharts.com/samples/data/aapl-c.json', function (data) {
    // Create the chart
    Highcharts.stockChart('container', {
        rangeSelector: {//from   w  w  w  .  j  a v a2 s  .c om
            selected: 1
        },
        title: {
            text: 'AAPL Stock Price'
        },
        tooltip:{
           enabled:true,
          split:false
        },
        series: [{
            name: 'AAPL',
            data: data,
            tooltip: {
                valueDecimals: 2
            }
        }]
    });
});

      </script>  
   </body>
</html>

Related Tutorials