Highcharts Event with TypeScript
I am using custom events in my Highcharts together with the React wrapper. As an example it toggles the legend when opening and closing the full screen.
const options: Highcharts.Options = {
chart: {
events: {
fullscreenOpen: function (this: any) {
this.update({
legend: {
enabled: true,
},
});
},
fullscreenClose: function (this: any) {
this.update({
legend: {
enabled: false,
},
});
},
},
},
};
Correct typing?
How can I type the event correctly and can get rid of the this: any?