Hide export menu in print page - Javascript highcharts

Javascript examples for highcharts:Context Menu

Description

Hide export menu in print page

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function() {//from  www. j a  v a 2 s  .  com
  $('#container').highcharts({
    chart: {
      events: {
         beforePrint:function() {
           this.exportSVGElements[0].box.hide();
          this.exportSVGElements[1].hide();
        },
        afterPrint:function() {
           this.exportSVGElements[0].box.show();
          this.exportSVGElements[1].show();
        }
      }
    },
    series: [{
      data: [1, 2, 3]
    }]
  });
  $("#b").click(function() {
    var chart = $('#container').highcharts();
    chart.print();
  });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <button id="b"> print with resize </button> 
      <div id="container" style="height: 400px"></div>  
   </body>
</html>

Related Tutorials