title: How to call highcharts button from outside
body: <p>I have a simple highcharts which contains a custom button,but here I need to initialize that button from out of highcharts,so that whenever I click on it,it should not hide,only chart should hide. Below is my code ,can anyone please help me on it.I have updated the code in this plunker
  <a href="http://plnkr.co/edit/YSLQMoQpKZqFPk0PXhXm?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/YSLQMoQpKZqFPk0PXhXm?p=preview</a></p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.highcharts.com/modules/series-label.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.highcharts.com/modules/export-data.js"&gt;&lt;/script&gt;
  &lt;div id="container"&gt;&lt;/div&gt;
  </code></pre>
  
  <h2>javascript</h2>
  
  <pre><code>Highcharts.chart('container', {
  
      title: {
          text: 'Solar Employment Growth by Sector, 2010-2016'
      },
  
      subtitle: {
          text: 'Source: thesolarfoundation.com'
      },
  
      yAxis: {
          title: {
              text: 'Number of Employees'
          }
      },
      legend: {
          layout: 'vertical',
          align: 'right',
          verticalAlign: 'middle'
      },
  
      plotOptions: {
          series: {
              label: {
                  connectorAllowed: false
              },
              pointStart: 2010
          }
      },
  
      series: [{
          name: 'Installation',
          data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
      }],
  
      responsive: {
          rules: [{
              condition: {
                  maxWidth: 500
              },
              chartOptions: {
                  legend: {
                      layout: 'horizontal',
                      align: 'center',
                      verticalAlign: 'bottom'
                  }
              }
          }]
      },
      exporting: {
          buttons: {
      'myButton': {       
          text: 'Custom Button',
                  onclick: function () {
                      alert('You pressed the button!');
                  },        
          theme: {
              class: "myButton highcharts-button highcharts-button-normal",
              id: "myDiamondButton"
          },
          onclick: function () {
                      alert('You pressed the button!');
                  }
      }
  }
  
      }
  
  });
  $("#myDiamondButton").click(function(){
      $('#container').hide();
  });
  </code></pre>