Update - The definitely typed Highcharts definition now has my fix, so you can download the latest version and hopefully it solves your problem.
The type definition for Highcharts assumes that you need to pass the amd array to yAxis. This compiles in TypeScript.
var chart = new Highcharts.Chart({ yAxis: [{ labels: { formatter: function (): string { return 'My Label'; } } }] });
However, I'm not sure if this is consistent with the documentation that suggests passing yAxis parameters as an object , and not as an array of many of these objects. It also makes sense from the point of view that you have one yAxis.
To achieve what, in my opinion, is a valid version (i.e. not arrays):
/// <reference path="highchart.d.ts" /> var yearChartOptions: HighchartsOptions = { yAxis: { plotLines: { label: { formatter: function (): string { return '$' + Highcharts.numberFormat(this.value / 1000, 0) + 'k '; } }, } } }; // Create the chart var yearChart = new Highcharts.Chart(yearChartOptions);
You can customize the highchart.d.ts file here ...
interface HighchartsOptions { chart?: HighchartsChartOptions;
I sent a upload request to a specific type to fix this.
A fully working example based on your code:
Fenton
source share