Can someone please help me in this, actually in my highcharts-angular application need to be display chart context menu as show in below image.
![](https://www.manongdao.com/static/images/pcload.jpg)
And I have gone through this https://www.highcharts.com/demo/pie-basic example but this whole code in javascript & Jquery. But here I need same functionality in highcharts-angular. Please find my sample code here https://stackblitz.com/edit/angular-s6h17i & please share your suggestions. Thanks in advance.
Highcharts context menu requires to import and initialize exporting
and export-data
modules:
import * as HighchartsExporting from "highcharts/modules/exporting";
import * as HighchartsExportData from "highcharts/modules/export-data";
HighchartsExporting(Highcharts);
HighchartsExportData(Highcharts);
Your app.component.ts:
import { Component, OnInit } from "@angular/core";
import * as Highcharts from "highcharts";
import * as HighchartsExporting from "highcharts/modules/exporting";
import * as HighchartsExportData from "highcharts/modules/export-data";
HighchartsExporting(Highcharts);
HighchartsExportData(Highcharts);
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"]
})
export class AppComponent implements OnInit {
Highcharts = Highcharts;
chartOptions = {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: "pie"
},
title: {
text: "Browser market shares in January, 2018"
},
tooltip: {
pointFormat: "{series.name}: <b>{point.percentage:.1f}%</b>"
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: "pointer",
dataLabels: {
enabled: true,
format: "<b>{point.name}</b>: {point.percentage:.1f} %"
},
showInLegend: true
}
},
credits: {
enabled: false
},
series: [
{
name: "Brands",
colorByPoint: true,
data: [
{
name: "Chrome",
y: 61.41,
sliced: true,
selected: true
},
{
name: "Internet Explorer",
y: 11.84
},
{
name: "Firefox",
y: 10.85
},
{
name: "Edge",
y: 4.67
},
{
name: "Safari",
y: 4.18
},
{
name: "Sogou Explorer",
y: 1.64
},
{
name: "Opera",
y: 1.6
},
{
name: "QQ",
y: 1.2
},
{
name: "Other",
y: 2.61
}
]
}
]
};
ngOnInit() {}
}
Demo:
https://codesandbox.io/s/2z2y2n07w0