A quick and complete guide to set up chart libraries and icon support for your Angular dashboard.
These libraries are essential for rendering interactive charts.
npm install c3
npm install d3β Note:
c3requiresd3, so both must be installed.
Font Awesome provides scalable vector icons used throughout the UI.
npm install @fortawesome/fontawesome-freeAdd Font Awesome styles to the styles array in angular.json:
"styles": [
"node_modules/@fortawesome/fontawesome-free/css/all.min.css",
"src/styles.scss"
]
β οΈ Place the Font Awesome entry before yourstyles.scssto prevent style override issues.
You can now use:
c3charts in Angular components.- Font Awesome icons directly in templates, e.g.:
<i class="fas fa-chart-line"></i>import * as c3 from 'c3';
ngAfterViewInit() {
c3.generate({
bindto: '#chart',
data: {
columns: [
['Data', 30, 200, 100, 400, 150, 250]
],
type: 'line'
}
});
}<i class="fas fa-chart-pie"></i> Chart Overviewdashboard/public/libs-outputs
- Use Node.js v19
- Start the project with:
ng serve