New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng2-charts

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-charts - npm Package Compare versions

Comparing version

to
0.46.0

components/charts/charts.ts

73

package.json
{
"name": "ng2-charts",
"version": "0.0.0",
"description": "Beautiful charts for Angular2 based on Chart.js",
"main": "index.js",
"version": "0.46.0",
"description": "angular2 charts components",
"scripts": {
"test": "npm test"
"deploy": "NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order",
"prepublish": "gulp clean && tsc && cp ./node_modules/chart.js/Chart.min.js ./components/external-lib",
"prestart": "npm install",
"server": "webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"start": "npm run server",
"test": "gulp lint"
},
"repository": {
"type": "git",
"url": "git+https://github.com/valor-software/ng2-charts.git"
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"typescript": {
"definition": [
"dist/module.d.ts",
"typings/es6-object.d.ts"
]
},
"files": [
"dist",
"components"
],
"keywords": [
"angular2",
"ng2",
"charts",
"angular2-charts",
"ng2-charts"
"bootstrap",
"angularjs",
"twitter-bootstrap"
],
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/valor-software/ng2-charts.git"
},
"bugs": {
"url": "https://github.com/valor-software/ng2-charts/issues"
},
"homepage": "https://github.com/valor-software/ng2-charts#readme"
"homepage": "https://github.com/valor-software/ng2-charts#readme",
"dependencies": {
"angular2": "2.0.0-alpha.46",
"ng2-bootstrap": "0.46.0",
"moment": "2.10.6",
"reflect-metadata": "0.1.1",
"zone.js": "0.5.4",
"chart.js": "1.0.2"
},
"devDependencies": {
"bootstrap": "3.3.6",
"clean-webpack-plugin": "0.1.3",
"compression-webpack-plugin": "0.2.0",
"eslint": "1.10.3",
"exports-loader": "0.6.2",
"gulp": "3.9.0",
"gulp-clean": "0.3.1",
"gulp-eslint": "1.1.1",
"gulp-size": "2.0.0",
"gulp-tsc": "1.1.4",
"gulp-tslint": "3.2.0",
"html-loader": "0.4.0",
"markdown-loader": "0.1.7",
"marked": "0.3.5",
"pre-commit": "1.1.1",
"prismjs": "valorkin/prism",
"prismjs-loader": "0.0.2",
"raw-loader": "0.5.1",
"require-dir": "0.3.0",
"ts-loader": "0.7.2",
"transfer-webpack-plugin": "^0.1.4",
"typescript": "1.7.3",
"webpack": "1.12.9",
"webpack-dev-server": "1.14.0"
}
}
# ng2-charts
Beautiful charts for Angular2 based on Chart.js
Directive for [ng2-charts](https://github.com/valor-software/ng2-charts) component.
## Placeholder for `ng2-charts` angular2 module
Please read central `ng2` modules [readme](https://github.com/valor-software/ng2-plans) for details, plans and approach
# Usage & Demo
[http://valor-software.github.io/ng2-charts/](http://valor-software.github.io/ng2-charts/)
- - -
## Quick start
1. A recommended way to install ***ng2-charts*** is through [npm](https://www.npmjs.com/search?q=ng2-charts) package manager using the following command:
`npm i ng2-charts --save`
Alternatively, you can [download it in a ZIP file](https://github.com/valor-software/ng2-charts/archive/master.zip).
2. A recommended way to install Chart.js component is through [Bower](http://bower.io/search/?q=chartjs) package manager using the following command:
`bower install Chart.js --save`
Alternatively, you can [download it in a ZIP file](https://github.com/nnnick/Chart.js/archive/master.zip).
3. After Chart.js component is downloaded, embed the code into your project.
```html
<script src="bower_components/Chart.js/Chart.min.js"></script>
```
4. More information regarding using of ***ng2-charts*** is located in
[demo](http://valor-software.github.io/ng2-charts/) and [demo sources](https://github.com/valor-software/ng2-charts/tree/master/demo).
## API
### Properties
- `data` (`Array<any>`) - set of points of the chart, it should be Array&lt;Array&lt;number&gt;&gt; only for line, bar and radar, otherwise Array&lt;number&gt;
- `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 doughnut
- `chart-type` (`?string`) - indicates the type of charts, it can be: 'Line', 'Bar', 'Radar', 'Pie', 'PolarArea', 'Doughnut'
- `options` (`?any`) - chart options (as from [Chart.js documentation](http://www.chartjs.org/docs/))
- `series` (`?Array<any>`) - name points on the chart, work for line, bar and radar
- `colours` (`?Array<any>`) - data colours, will use default colours if not specified ([see readme for components](https://github.com/valor-software/ng2-charts/blob/master/components/charts/readme.md))
- `legend`: (`?boolean=false`) - if true show legend below the chart, otherwise not be shown
### Events
- `chart-click`: fires when click on a chart has occurred, returns information regarding active points and labels
- `chart-hover`: fires when mousemove (hover) on a chart has occurred, returns information regarding active points and labels
## Troubleshooting
Please follow this guidelines when reporting bugs and feature requests:
1. Use [GitHub Issues](https://github.com/valor-software/ng2-charts/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](https://github.com/valor-software/ng2-charts/blob/master/LICENSE) file for the full text)