PrimeNG charts v6 configuration
Note: @angular/animations
are not required, it was already installed with Angular Material
$ npm install primeng --save
$ npm install primeicons --save
$ npm install @angular/animations --save
$ npm install chart.js --save
$ npm install font-awesome --save
angular.json
should have these additions
[...]
"styles": [
[...],
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css"
],
"scripts": [
[...],
"node_modules/chart.js/dist/Chart.js"
]
[...]
otherwise index.html
should have these additions
<head>
[...]
<link rel="stylesheet" type="text/css" href="/node_modules/primeicons/primeicons.css" />
<link rel="stylesheet" type="text/css" href="/node_modules/primeng/resources/themes/nova-light/theme.css" />
<link rel="stylesheet" type="text/css" href="/node_modules/primeng/resources/primeng.min.css" />
[...]
</head>
<body>
[...]
<script src="node_modules/chart.js/dist/Chart.js"></script>
</body>
It is thrown the following message: ERROR ReferenceError: "Chart is not defined"
when chart.js
dependency is not present in the project in either index.html
or angular.json
.
- PrimeNG by PrimeFaces.org
- PrimeNG Get Started
- PrimeNG charts 6
- Primeng with Angular 6 example from scratch with tutorials | Primeng Angular Tutorial Example
- Using primeng with angular 4
- Angular 7 UI Components (Angular 7 Chart) from jQWidgets.com
- Angular Chart its dependencies are (2018-11-14):