0

In my application, there is a app.module under that page.module and then dashboard.module.

Whenever i am tring to use ngxechart for component inside dashboard.module its giving error i.e

Can't bind to 'options' since it isn't a known property of 'div'.:

<div id="chart" echarts [options]="echartMapOption" style="width: 800px; height: 600px;background-color: bisque;"></div>

I have tried multiple solution.Its working fine in app.component but not in child module component.

1 Answers1

0

Can you please check whether NgxEchartsModule is imported in app.module.ts?

import { NgxEchartsModule } from 'ngx-echarts';
Tamilvanan
  • 23
  • 2
  • 7
  • Yes, its already imported in app.module.ts. Maping in app.module.ts: import { NgxEchartsModule } from 'ngx-echarts'; NgxEchartsModule.forRoot({ echarts: () => import('echarts') }), – Anjana Rana Jun 01 '23 at 11:26
  • Instead of `NgxEchartsModule.forRoot({ echarts: () => import('echarts') })` try this `NgxEchartsModule.forRoot({ echarts })` [This](https://stackblitz.com/edit/angular-9-ngx-echarts?file=src%2Fapp%2Fapp.module.ts) is a working example, please refer to whether all the imports you made are correct. – Tamilvanan Jun 02 '23 at 03:13
  • Still Not working for nested module component. – Anjana Rana Jun 21 '23 at 12:45