apexcharts / ng-apexcharts

ng-apexcharts is an implementation of apexcharts for angular. It comes with one simple component that enables you to use apexcharts in an angular project.
MIT License
313 stars 78 forks source link

Append Series not functioning properly on Angular #133

Open BradRaynaudCIC opened 3 years ago

BradRaynaudCIC commented 3 years ago

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.

BradRaynaudCIC commented 3 years ago

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.

Havock94 commented 2 years ago

+1, looks like every combination of parameters passed to the appendSeries method are not accepted as valid.