Home › Forums › Chart Support › Monthly Expense (pie chart Angular5) npm install canvasjs › Reply To: Monthly Expense (pie chart Angular5) npm install canvasjs
We don’t have official NPM package as of now. However, CanvasJS Chart works fine with all versions of Angular / AngularJS including Angular 5. Below are the steps to integrate CanvasJS Chart / StockChart in your angular app.
1. Save canvasjs.min.js (canvasjs.stock.min.js incase of StockChart) within source-folder of your Angular application ( src or src/assets or src/lib )
2. Import the library into your app.
For Chart: import * as CanvasJS from './canvasjs.min';
For StockChart: import * as CanvasJS from './canvasjs.stock.min';
import * as CanvasJS from './canvasjs.min';
import * as CanvasJS from './canvasjs.stock.min';
Once it’s imported, you are ready to go. Now you can create Chart / StockChart, pass options & render them.
Please check out Angular Gallery for examples on integrating charts in Angular app.