ng-apexcharts icon indicating copy to clipboard operation
ng-apexcharts copied to clipboard

Any idea for 'apx-chart' is not a known element?

Open MarvinWang opened this issue 2 years ago • 5 comments

//My env. Angular版本:V12 Angular CLI: 12.2.17 Node: 14.17.3 Package Manager: npm 6.14.13 OS: darwin x64 Typescript:4.3.5 IDE Tool:Visual Studio Code

when I followed the steps one, two, three for downloading and installing Apexcharts, I got an error under the ' 'tag in the *.component.html like ..

image

pls tell me how to resolve this issue...

MarvinWang avatar Apr 13 '22 15:04 MarvinWang

You need to import NgApexchartsModule in your app.modules.ts file and then, in @NgModules, in your imports, import the NgApexchartModule

import { NgApexchartsModule } from "ng-apexcharts"

@NgModule({  
  ......

  imports: [
    NgApexchartsModule
  ]
})

tguimmaraess avatar Apr 17 '22 11:04 tguimmaraess

same error, the solution of tguimmaraess is not working

Noext avatar May 25 '22 07:05 Noext

same error, the solution of tguimmaraess is not working

Could you provide a repository or a link to https://stackblitz.com/?

Here's an example: https://stackblitz.com/edit/angular-ivy-agzta9?file=src/app/app.component.html, https://angular-ivy-agzta9.stackblitz.io

By the way, it's apx-chart not apex-chart

tguimmaraess avatar May 25 '22 16:05 tguimmaraess

I got it working by importing directly into the individual page modules, not into my app.module.ts

billygerhard avatar Jun 27 '22 21:06 billygerhard

I spent too long on this one.

For me, I jumped the gun and had not declared the component that I was using ngApexChartsModule. Once declared, it all worked as it should... This problem doesn't show up on the stackblitz examples as it is all contained in one module and component.

E.g. if for using ScatterComponent in a page called Fields:

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    FieldsPageRoutingModule,
    NgApexchartsModule
  ],
  declarations: [FieldsPage, ScatterComponent],
})

benboughton1 avatar Nov 01 '22 11:11 benboughton1