Ahh okay, I understand! You're having TypeScript issues.
But in the link you've sent me I do not see any TS error thrown.
Should there be something? Or did you solve your issue?
You have all the available Highcharts classes & interfaces listed on this website: https://api.highcharts.com/class-reference/classes.list
Keep in mind that not everything in Highcharts works great with TypeScript yet, we're currently working on it. If you want to avoid casting you might need to define some custom interfaces yourself.
I believe that you will solve this problem if you specify that
Code: Select all
const chart: Highcharts.Chart = this;
because if not, then the type of this
is taken from the object function render (and I believe that this error stems from this).
However, in the demo you've sent this config is specified in a .js file, not in a .ts file so there's no issue there.
Here's a working TypeScript example
: https://codesandbox.io/s/chart-ts-forke ... /chart.tsx