ng-apexcharts
ng-apexcharts copied to clipboard
Append Series not functioning properly on Angular
Hello,
I am attempting to utilize the appendSeries function to dynamically add lines to a line chart so that if the data changes the chart can accommodate. However, when I attempt to call the function and pass in a valid series I get the following error:
ERROR TypeError: Cannot read property 'appendSeries' of undefined
Here is my append statement
this.chart.appendSeries({ name: "TestSeries", data: [10,11,12,13,14,15,16,17] })
Furthermore my linter indicates that the data format that I am using is invalid despite using a format identical to the docs page (here).
(TS) Argument of type '{ name: string; data: number[]; }' is not assignable to parameter of type 'ApexAxisChartSeries | ApexNonAxisChartSeries'. Object literal may only specify known properties, and 'name' does not exist in type 'ApexAxisChartSeries | ApexNonAxisChartSeries'
Any advice on how to either generate a series object that I can pass into this function or properly append a series to a graph in angular would be appreciated.
Update:
After testing further it looks like I am not able to interact with the chart at all after it has been instantiated. Any attempt to use any of the methods (Here) result in an undefined error. The only way to update/change the data is by setting the chartOption.series.
+1, looks like every combination of parameters passed to the appendSeries method are not accepted as valid.