Currently, I am trying to implement a tooltip activation on click event in Highcharts by following an example from this URL: Highcharts - Show tooltip on points click instead mouseover. The challenge I'm facing is that I am using TypeScript and struggling to correctly translate the following line to TypeScript:
this.myTooltip = new Highcharts.Tooltip(this, this.options.tooltip);
The specific error message I encounter is: "Property Tooltip does not exist on type HighchartsStatic"
To address this issue, I attempted to add a new member to my controller as shown below:
public highchartTooltip: HighchartsTooltipOptions;
Followed by:
this.myTooltip = new self.highchartTooltip(this, this.options.tooltip);
However, this resulted in the error: "Cannot use 'new' with an expression whose type lacks a call or construct signature"... leaving me unsure how to create an object for initializing the tooltip according to the JavaScript example.
I also checked the definition of tooltip in this link:
var Tooltip = Highcharts.Tooltip = function () {
this.init.apply(this, arguments);
};
Tooltip.prototype = {...
Despite this, I couldn't figure out how to locate it in the TypeScript definition file.
You can find the complete JavaScript example here: http://jsfiddle.net/2swEQ/2/
I've submitted a ticket on GitHub for assistance: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9960
Is there any way to overcome this error? Maybe somehow ignore it and assume that the Highcharts.Tooltip object exists when the application is running?