In my angular component file, I am utilizing 'angular-highcharts' to create a high chart for the HTML view page. To do this, I have defined an array as shown below in the component.ts file to store and organize the data.
public myData : Array< number | [number, number] | [string, number]>;
When attempting to add data to the array using the push method like so:
this.myData.push(12540 ,2488);
The code compiles without errors, but when running it, I encounter the following runtime error:
core.js:1624 ERROR TypeError: Cannot read property 'push' of undefined
at third-page.component.ts:136
at Array.forEach (<anonymous>)
at SafeSubscriber._next (third-page.component.ts:118)
at
Do you have any suggestions on the best approach to insert data into the myData array that would allow me to successfully bind it to the chart?