1. Install npm dependencies
Download and install dependencies in the Angular root directory
npm install echarts --save
npm install ngx-echarts --save
2. Import files
Angular.json
introduces "node_modules/echarts/dist/echarts.js" in the scripts of Angular.json.
Both build and test need to be introduced
3. Import module
4. Use
<div style="height: 99%; width: 99%" echarts [options]="lineOptions" [loading]="true" [autoResize]="true"></div>
Note: You don’t need to use the complicated method in the echarts document to achieve self-adaptation, but use it in npm ng-echarts, as follows:
Explore more functions by yourself