简体   繁体   中英

How to use chart.js with jhipster project

So i want to try out Chat.js with the following project.

https://github.com/mraible/jhipster4-demo

So i researched and came across the following http://valor-software.com/ng2-charts/

So i installed ng-2 charts. ng2-charts required chart.js so I also installed chart.js and i can see it under node_modules of jhipster4-demo project.

ng2 chart says

Embedding Chart.js in application is mandatory!

<script src="node_modules/chart.js/src/chart.js"></script>

How to do the above mandatory step in jhipster4-demo project ? Since i am not a webpack expert not sure how to do this.

Import your libs into src/main/webapp/app/vendor.ts :

import 'chart.js/src/chart.js';

This is what is explained in the "Managing dependencies" section of the README.md file also generated in Matt Raible's demo application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM