Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

highchart export button not show

Tags:

highcharts

I´m prooving highcharts with a simple graph in angular . But export button not show . I add the script in html page :

<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/exporting.js"></script>  
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>  
<script src="https://code.highcharts.com/modules/export-data.js"></script>

and add the properties in chart :

export :true,
navigation: {
  buttonOptions: {
    align: 'right',
    verticalAlign: 'top',
    y: 0
  }
},

but nothing.

this is te app url :

https://stackblitz.com/edit/angular-hkncp8

like image 657
sebas0205 Avatar asked Feb 23 '26 01:02

sebas0205


1 Answers

There is a typo on your call (exporting not export), also you should set menu items:

exporting: {
      buttons: {
        contextButton: {
          menuItems: [
            'viewFullscreen', 'separator', 'downloadPNG',
            'downloadSVG', 'downloadPDF', 'separator', 'downloadXLS'
          ]
        },
      },
      enabled: true,
    },
navigation: {
  buttonOptions: {
    align: 'right',
    verticalAlign: 'top',
    y: 0
  }
},

And you need to import exporting modules to this same file:

import { Component, OnInit, OnDestroy } from '@angular/core';
import * as Highcharts from 'highcharts';
import { HttpClient } from '@angular/common/http';
import { interval, Subscription } from 'rxjs';

require('highcharts/modules/exporting')(Highcharts);
require('highcharts/modules/export-data')(Highcharts);
require('highcharts/modules/annotations')(Highcharts);

declare var require: any;
(...)

Live demo: https://stackblitz.com/edit/angular-1ylkg8

API reference: https://api.highcharts.com/highcharts/exporting

like image 108
Bernardo Marques Avatar answered Feb 25 '26 15:02

Bernardo Marques



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!