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
319 stars 79 forks source link

TypeScript Error When Using ng-apexcharts During Build Time #342

Open jxtorrez opened 3 months ago

jxtorrez commented 3 months ago

TypeScript Error When Using ng-apexcharts During Build Time

Description

I'm encountering a TypeScript error when trying to use ng-apexcharts in my Angular project. Specifically, I'm seeing the following error message:

Error: node_modules/ng-apexcharts/lib/chart/chart.component.d.ts:59:80 - error TS2344: Type '{ chart: { alias: "chart"; required: false; }; annotations: { alias: "annotations"; required: false; }; colors: { alias: "colors"; required: false; }; dataLabels: { alias: "dataLabels"; required: false; }; ... 18 more ...; autoUpdateSeries: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"chart"' is incompatible with index signature.
    Type '{ alias: "chart"; required: false; }' is not assignable to type 'string'.

59     static ɵcmp: i0.ɵɵComponentDeclaration<ChartComponent, "apx-chart", never, { "chart": { "alias": "chart"; "required": false; }; "annotations": { "alias": "annotations"; "required": false; }; "colors": { "alias": "colors"; "required": false; }; "dataLabels": { "alias": "dataLabels"; "required": false; }; "series": { "alias": "series"; "required": false; }; "stroke": { "alias": "stroke"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "legend": { "alias": "legend"; "required": false; }; "markers": { "alias": "markers"; "required": false; }; "noData": { "alias": "noData"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "plotOptions": { "alias": "plotOptions"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "xaxis": { "alias": "xaxis"; "required": false; }; "yaxis": { "alias": "yaxis"; "required": false; }; "forecastDataPoints": { "alias": "forecastDataPoints"; "required": false; }; "grid": { "alias": "grid"; "required": false; }; "states": { "alias": "states"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "autoUpdateSeries": { "alias": "autoUpdateSeries"; "required": false; }; }, { "chartReady": "chartReady"; }, never, never, false, never>;

Steps to Reproduce:

  1. Install ng-apexcharts using npm.
  2. Set up a basic chart according to the documentation.
  3. While attempting to compile, I encountered the error mentioned above.

Steps Tried:

Environment:

Please help me.

abieru commented 3 months ago

i have the same error

dnyanesh94 commented 2 months ago

I am also facing same issue. node 16, 18, 22 with these version

abieru commented 2 months ago

work on version 1.10.0 ng-apexchart