0👍
You need to add p-chart in declarations : [ ] in app.module.ts so that you can access it in other components.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SalesComponent } from './sales.component';
import { GenericModule } from '../generic.module';
import { ChartModule } from 'primeng/chart';
import { PChartComponent} from './pchart.component';
@NgModule({
declarations: [SalesComponent, PChartComponent],
imports: [
CommonModule,
GenericModule,
ChartModule
]
})
export class SalesModule { }
- Chartjs-Javascript chart.js data object/array
- Chartjs-Using data saved as a variable in HTML from Python
Source:stackexchange.com