Customize drillup button - Javascript highcharts

Javascript examples for highcharts:Chart Drilldown

Description

Customize drillup button

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

.highcharts-drillup-button rect {
   width: 70px;
   height: 32px;
}


      </style> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/data.js"></script> 
      <script src="https://code.highcharts.com/modules/drilldown.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> 
      <script type="text/javascript">
Highcharts.setOptions({//from  w  w w.  j av  a  2  s  . c o  m
  lang: {
    drillUpText: ''
  }
});
Highcharts.chart('container', {
  chart: {
    type: 'column',
    events: {
      load: function() {
        var chart = this,
          renderer = chart.renderer,
          pattern = renderer.createElement('pattern').add(renderer.defs).attr({
            width: 1,
            height: 1,
            id: 'arrow'
          });
        renderer.image('https://png.icons8.com/reply-arrow/50', 10, 0, 45, 30).add(pattern);
        pattern = renderer.createElement('pattern').add(renderer.defs).attr({
          width: 1,
          height: 1,
          id: 'coloured-arrow'
        });
        renderer.rect(0, 0, 70, 32)
          .attr({
            fill: '#a4edba'
          })
          .add(pattern);
        renderer.image('https://png.icons8.com/reply-arrow/50', 10, 0, 45, 30).add(pattern);
      }
    }
  },
  series: [{
    name: 'Brands',
    colorByPoint: true,
    data: [{
      name: 'Microsoft Internet Explorer',
      y: 56.33,
      drilldown: 'Microsoft Internet Explorer'
    }]
  }],
  drilldown: {
    drillUpButton: {
      position: {
        width: 50,
        height: 20
      },
      theme: {
        fill: 'url(#arrow)',
        'stroke-width': 1,
        stroke: 'silver',
        r: 0,
        states: {
          hover: {
            fill: 'url(#coloured-arrow)',
          }
        }
      }
    },
    series: [{
      name: 'Microsoft Internet Explorer',
      id: 'Microsoft Internet Explorer',
      data: [
        ['v11.0', 24.13],
        ['v8.0', 17.2],
        ['v9.0', 8.11],
        ['v10.0', 5.33],
        ['v6.0', 1.06],
        ['v7.0', 0.5]
      ]
    }]
  }
});

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

Related Tutorials