Highcharts Demo

author(s): Torstein Hønsi

by Black Label

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container"></div>

JavaScript

Highcharts.chart('container', {
  series: [{
    data: [
      29.9, 71.5,
      106.4, 129.2,
      144.0, 176.0,
      135.6, 148.5,
      216.4, 194.1,
      95.6, 54.4
    ]
  }],
  exporting: {
    menuItemDefinitions: {
      small: {
      	text: 'Download small PNG',
        onclick: function() {
          this.exportChart({
            type: "image/png"
          }, {
            chart: {
              width: 200,
              height: 200
            }
          });
        }
      },
      big: {
      	text: 'Download big PNG',
        onclick: function() {
          this.exportChart({
            type: "image/png"
          }, {
            chart: {
              width: 1920,
              height: 1080
            }
          });
        }
      }
    },
    buttons: {
      contextButton: {
        menuItems: ['small', 'big']
      }
    }
  }
});