Skip to content

Instantly share code, notes, and snippets.

@vades
Last active May 21, 2019 06:07
Show Gist options
  • Save vades/dc9203285fcb467ff61a581f55ccf68d to your computer and use it in GitHub Desktop.
Save vades/dc9203285fcb467ff61a581f55ccf68d to your computer and use it in GitHub Desktop.
Angular and Chart.js with ng2-charts

Angular and Chart.js with ng2-charts

Chart.js is a JavaScript library which makes it easy to create animated and responsive charts. If you want to combine Chart.js with Angular you can use ng2-charts.

Tested on

  • Angular: 7.0.3
  • Node: 8.10.0
  • Typescript: 3.1.6

Install Chart.js using npm

npm install ng2-charts --save

Install ng2-charts using npm

npm install chart.js --save

NOTE: You don't have to add

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

if you are using angular-cli. Angular-cli packs ng2-charts lib and add it automatically.

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment