Stacked Percentage Column Hyperlink in column chart - Javascript highcharts

Javascript examples for highcharts:Column Chart

Description

Stacked Percentage Column Hyperlink in column 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.9.1.js"></script> 
      <script type="text/javascript">
 jQuery.noConflict();//from   w w  w . j a va  2 s.com
         (function ($) {
             $(document).ready(function () {
                 // $(function () {
                 $('#container').highcharts({
                     chart: {
                         type: 'column'
                     },
                     title: {
                         text: 'STORM Space Overview'
                     },
                     xAxis: {
                         categories: ['a','b','c','d']
                     },
                     yAxis: {
                         min: 0,
                         title: {
                             text: 'Total Space (%)'
                         }
                     },
                     tooltip: {
                         pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
                         shared: true
                     },
                     plotOptions: {
                         column: {
                             stacking: 'percent'
                         },
                        series: {
                                        cursor: 'pointer',
                                        point: {
                                            events: {
                                                click: function (event) {
                                                    window.open(event.point.url);
                                                }
                                            }
                                        }
                                    }
                                },
subtitle: {
            text: '+ Items relate to items in the dispay cabinets.',
            align: 'left',
            x: 10
        },
                     series: [{
                         name: 'Free',
                         data: [
                            { y: 1498, url: 'http://www.google.com' },
                            { y: 1123, url: 'http://www.yahoo.com' },
                            { y: 556, url: 'http://www.bing.com' },
                            { y: 1176, url: 'http://www.msn.com' }
                         ]
                     }, {
                         name: 'Used',
                         data: [1234,233,23,759]
                     }]
                 });
             });
         })(jQuery);

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

Related Tutorials