javascript - How to use Highcharts.Tooltip type in typescript -
i following example related active tooltip using click event in highchart url highcharts - show tooltip on points click instead mouseover. thing using typescript , can' find correct way translate line typescript:
this.mytooltip = new highcharts.tooltip(this, this.options.tooltip);
the error getting is: "property tooltip doesn' exist on type highchartsstatic"
i tried add new member controller this:
public highcharttooltip : highchartstooltipoptions;
and after :
this.mytooltip = new self.highcharttooltip(this, this.options.tooltip);
but getting error: "cannot use 'new' expression type lacks call or construct signature"... don't know how create object initialize tooltip according js example.
also can see definition of tooltip in http://code.highcharts.com/highcharts.src.js
var tooltip = highcharts.tooltip = function () { this.init.apply(this, arguments); }; tooltip.prototype = {...
but can't figure out how find in typescript definition file.
the complete example in js here: http://jsfiddle.net/2sweq/2/
i have opened ticket in github: https://github.com/definitelytyped/definitelytyped/issues/9960
any help? in how there way ignore error? (thinking object highcharts.tooltip exists when app runing)
this late answer, perhaps might future users.
in (definitelytyped) highcharts .d.ts file, tooltip not defined class interface. api docs mentions.
which means, you're able following instead typescript:
let tooltipoptions = <highcharts.tooltipoptions> { // options here... }; let chart = new highcharts.chart({ tooltip: tooltipoptions });
Comments
Post a Comment