How to implement chart.js in Angular2

后端 未结 6 1647
刺人心
刺人心 2020-12-14 09:19

I\'m using Angular2-rc4 with angular-cli webpack and would like to implement a chart.js library.

I\'ve installed chart.js to my project using:

6条回答
  •  隐瞒了意图╮
    2020-12-14 10:13

    If you are using webpack you may try adding the chart.js file (or the minified version) to the entry property as follows:

    ...
    entry: {
          'chartJS': './node_modules/chart.js/dist/Chart.bundle.min.js',
          // Other mappings
    }
    ...
    

提交回复
热议问题