Highstock grouping show hidden series values in tooltip - Javascript highcharts

Javascript examples for highcharts:Chart Tooltip

Description

Highstock grouping show hidden series values in tooltip

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-3.1.1.js"></script> 
      <script type="text/javascript">
$(function() {/*from  ww  w  . ja v a 2s.  c o m*/
  // Create the chart
  Highcharts.stockChart('container', {
    plotOptions: {
      series: {
        pointStart: Date.UTC(2016, 1, 1),
        pointInterval: 1000 * 3600 * 24,
        dataGrouping: {
          enabled: true,
          forced: true,
          units: [['day', [2]]]
        }
      }
    },
    tooltip: {
      shared: true,
      formatter: function () {
        var points = this.points;
        return 's1: ' + points[0].y + '<br>s2: ' + points[1].y + '<br>s3: ' + (points[2] ? points[2].y : 'N/A');
      }
    },
    legend: {
      enabled: true
    },
    rangeSelector: {
      enabled: false
    },
    yAxis: [{
    },{
      visible: false
    }],
    series: [{
      name: 's1',
      data: [10, 10, 10, 10, 10, 10]
    }, {
      name: 's2',
      data: [1, 1, 1, 1, 1, 1]
    }, {
      name: 's3',
      data: [-2, -2, -2, -2, -2, -2],
      enabledMouseTracking: false,
      color: 'none',
      yAxis: 1
    }]
  });
});

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

Related Tutorials