click on scatter point with line series in stock chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

click on scatter point with line series in stock 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://code.jquery.com/jquery-1.7.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from   w w  w  .j av  a 2 s.  c  o  m
var chart = new Highcharts.StockChart({
    chart: {
        renderTo: 'container'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },
    navigator:{
        baseSeries:1
    },
    plotOptions: {
        series: {
            cursor: 'pointer',
            point: {
                events: {
                    click: function(event) {
                        console.log('Category: '+ this.category +', value: '+ this.y + event.point.series.name);
                    }
                }
            }
        }
    },
    series: [
        {
        type: "scatter",
        name: "scatter series",
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    },
        {
        type: "line",
        name:"line series",
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
});
    });

      </script> 
   </head> 
   <body> 
      <div id="container"></div> 
      <script src="https://code.highcharts.com/stock/1.2/highstock.js"></script>  
   </body>
</html>

Related Tutorials