Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

ng2-charts-x

Package Overview
Dependencies
2
Maintainers
1
Versions
10
Issues
File Explorer

Advanced tools

ng2-charts-x

Reactive, responsive, beautiful charts for Angular2 based on Chart.js

    2.0.6latest

Version published
Maintainers
1
Yearly downloads
13,840
decreased by-41.22%

Weekly downloads

Readme

Source

ng2-charts-x npm version npm downloads

Beautiful charts for Angular2 based on Chart.js

NPM NPM

This is a fork of ng2-charts from valor-software that fixes some bugs which were not addressed in the original for a long time.

Usage & Demo

Currently only the original demo that is using ng2-charts is available.

Sample in below website uses [email protected]

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


Installation (using angular-cli)

  1. Install ng2-charts-x using npm
npm install ng2-charts-x --save

This also installs chart.js and moment.

  1. Add to your app.module.ts
import { ChartsModule } from 'ng2-charts-x'; // In your App's module: imports: [ ChartsModule ]
  1. Enjoy

API

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

  • data (Array<number[]> | number[]) - set of points of the chart, it should be Array<number[]> only for line, bar and radar, otherwise number[];
  • datasets (Array<{data: Array<number[]> | number[], label: string}>) - data see about, the label for the dataset which appears in the legend and tooltips
  • labels (?Array<any>) - x axis labels. It's necessary for charts: line, bar and radar. And just labels (on hover) for charts: polarArea, pie and doughnut
  • chartType (?string) - indicates the type of charts, it can be: line, bar, radar, pie, polarArea, doughnut
  • options (?any) - chart options (as from Chart.js documentation)
  • colors (?Array<any>) - data colors, will use default and|or random colors if not specified (see below)
  • legend: (?boolean=false) - if true show legend below the chart, otherwise not be shown

Events

  • chartClick: fires when click on a chart has occurred, returns information regarding active points and labels
  • chartHover: fires when mousemove (hover) on a chart has occurred, returns information regarding active points and labels

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
  2. Please give a short description how to reproduce the error.

License

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

Keywords

FAQs

What is ng2-charts-x?

Reactive, responsive, beautiful charts for Angular2 based on Chart.js

Is ng2-charts-x popular?

The npm package ng2-charts-x receives a total of 187 weekly downloads. As such, ng2-charts-x popularity was classified as not popular.

Is ng2-charts-x well maintained?

We found that ng2-charts-x demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 21 Dec 2017
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc