valor-software/ng2-charts

Name: ng2-charts

Owner: Valor Software

Description: Beautiful charts for Angular based on Chart.js

Created: 2015-08-27 10:34:52.0

Updated: 2018-05-23 10:52:47.0

Pushed: 2018-05-11 14:18:17.0

Homepage: http://valor-software.github.io/ng2-charts/

Size: 28309

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ng2-charts npm version npm downloads slack

Beautiful charts for Angular2 based on Chart.js

NPM NPM

Usage & Demo

Sample in below website uses ng2-charts@1.1.0

http://valor-software.github.io/ng2-charts/ http://plnkr.co/edit/7fGsiuRjcF0M0Ffeoml2?p=preview


Installation
  1. You can install ng2-charts using npm

    install ng2-charts --save
    
  2. You need to install and include Chart.js library in application via html or webpack bundler (more options can be found in official chart.js documentation)

    install chart.js --save
    

    Important: Embedding Chart.js in application is mandatory!

    ipt src="node_modules/chart.js/src/chart.js"></script>
    
    Usage & Demo

    Demo and API details of ng2-charts can be found here: demo and source code.

System.js

System.js bundles can be found in bundles directory of npm package or at npm cdn

API
Import
rt { ChartsModule } from 'ng2-charts/ng2-charts';

n your App's module:
rts: [
hartsModule

Chart types

There are one directive for all chart types: base-chart, and there are 6 types of charts: , line, bar, radar, pie, polarArea, doughnut.

Properties

Note: For more information about possible options please refer to original chart.js documentation

Events
Colors

There are a set several default colors. Colors can be replaced using the colors attribute. If there is more data than colors, colors are generated randomly.

Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

Thanks for understanding!

License

The MIT License (see the LICENSE file for the full text)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.