Warm tip: This article is reproduced from stackoverflow.com, please click
highcharts javascript

How to remove/hide export button in full screen view in highcharts-angular

发布于 2020-03-27 15:43:14

enter image description here

For Reference find the screenshot. Already tried https://www.highcharts.com/forum/viewtopic.php?f=9&t=42208 but still its not working.

Questioner
Sameena Waida
Viewed
151
Sameena Waida 2020-02-03 14:10

Fixed by using following snippet

     let chart2FullScreen = true;
let chart1fullScreen = true;

document.addEventListener('fullscreenchange', (event) => {

  if (event.target['id'] === 'divId1') {
      Highcharts.charts[0].update({
      exporting: {
        buttons: {
          contextButton: {
            enabled: chart1FullScreen ? false : true
          }
        }
      }
    });
    chart1FullScreen = !chart1FullScreen ;
  } else if (event.target['id'] === 'divId2') {
    Highcharts.charts[1].update({
      exporting: {
        buttons: {
          contextButton: {
            enabled: chart2fullScreen ? false : true
          }
        }
      }

    });
    chart2fullScreen = !chart2fullScreen;
  }

});