Beautiful charts for Angular2 based on Chart.js
Follow me at twitter to be notified about new releases.
http://valor-software.github.io/ng2-charts/
- A recommended way to install ng2-charts is through npm package manager using the following command:
npm i ng2-charts --save
- A way to install Chart.js component is through npm package manager using the following command:
bower install Chart.js --save
Alternatively, you can download it in a ZIP file.
After Chart.js component is downloaded, embed the code into your project.
<script src="bower_components/Chart.js/Chart.min.js"></script>
- Or you can link
charts.js
at cdn
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
- More information regarding using of ng2-charts is located in demo and demo sources.
data
(Array<any>
) - set of points of the chart, it should be Array<Array<number>> only for line, bar and radar, otherwise Array<number>labels
(?Array<any>
) - x axis labels. It's necessary for charts: line, bar and radar. And just labels (on hover) for charts: polar area, pie and doughnutchartType
(?string
) - indicates the type of charts, it can be: 'Line', 'Bar', 'Radar', 'Pie', 'PolarArea', 'Doughnut'options
(?any
) - chart options (as from Chart.js documentation)series
(?Array<any>
) - name points on the chart, work for line, bar and radarcolours
(?Array<any>
) - data colours, will use default colours if not specified (see readme for components)legend
: (?boolean=false
) - if true show legend below the chart, otherwise not be shown
chartClick
: fires when click on a chart has occurred, returns information regarding active points and labelschartHover
: fires when mousemove (hover) on a chart has occurred, returns information regarding active points and labels
Please follow this guidelines when reporting bugs and feature requests:
- Use GitHub Issues board to report bugs and feature requests (not our email address)
- 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!
The MIT License (see the LICENSE file for the full text)