NG2-Charts Can't bind to 'datasets' since it isn't a known property of 'canvas'
Try importing ChartsModule in your app.module.ts like this-
import { ChartsModule } from 'ng2-charts/ng2-charts';
imports: [
.....
ChartsModule
.....
]
I had the very same problem. I found on github that you just have to insert the ChartsModule in the submodule as well. First you add in app.module.ts
and the, in my case, reports.module.ts
.
I'm working with ng2-charts + Angular 7 + Ionic 4, and I spent several hours searching for a solution. And this finally worked to me (after following the initial steps, of course, like installing ng2-charts and charts.js). Just import ChartsModule on the following files:
app.module.ts
import { ChartsModule } from 'ng2-charts';
...
imports: [ChartsModule]
yourPage.module.ts
import { ChartsModule } from 'ng2-charts';
@NgModule({
imports: [
IonicModule,
CommonModule,
FormsModule,
RouterModule.forChild([{ path: '', component: YourPagePage }]),
**ChartsModule**
]
})
I was trying to import it also in yourPage.page.ts, but the solution was to import it in yourPage.module.ts!
Try it out.