ZingChartMaps ZC is not defined

120 views Asked by At

I am testing ZingCharts for Angular with a small local project. I am having trouble with getting the ZingChartMap to work. All other ZingCharts work as expected. Currently, I am working with Angular 12. Where I am having trouble is with JS files zingchart-maps.min.js and zingchart-maps-usa.min.js. Something in them is causing an error. I am using zingchart-angular 1.0.9. Anyone familiar with the below error and know how to resolve?

core.js:6498 ERROR Error: Uncaught (in promise): ReferenceError: ZC is not defined ReferenceError: ZC is not defined at Object.6272 (zingchart-maps.min.js:8:1)

1

There are 1 answers

0
user309810 On

I found three solutions that could work. #1 is the prefered solution

  1. I needed to import ZingChartAngular module before the FeatureModuleRouting Module. Good practice is to place @angular modules first, third party modules second, and local modules last.

  2. I needed to import the ZingChartAngular module to the app.module.ts file and the feature module ts file.

  3. I needed to import ZingChartAngular module to the feature module ts file, and only export the ZingChartAngular module in app.module.ts.