# ngx-g2

> g2 component for angular

Latest version **0.1.0** (published 2017-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-g2
pnpm add ngx-g2
yarn add ngx-g2
bun add ngx-g2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-04-11 |
| First published | 2017-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vadym Yatsyuk |
| Maintainers | vadimdez |
| Keywords | g2, angular2-g2, g2-component |

## Links

- npm: https://www.npmjs.com/package/ngx-g2
- Homepage: https://github.com/VadimDez/ng2-order-pipe#readme
- Issues: https://github.com/VadimDez/ng2-order-pipe/issues
- npm.io page: https://npm.io/package/ngx-g2

## Recent versions

- 0.1.0 (latest) — 2017-04-11
- 0.0.1 — 2017-04-09
- 0.0.0 — 2017-03-27

## README

# G2 Component for Angular >= 2

<img width="500" src="https://cloud.githubusercontent.com/assets/3748453/24840899/3a926fbe-1d77-11e7-910f-a9673cb754fa.png"/>

#### [Demo](https://vadimdez.github.io/ngx-g2/)

### Install

```
npm install ngx-g2 --save
```

### Usage

Import `G2Module` to your Module

```ts
import { G2Module } from 'ngx-g2';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    G2Module
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

Your component
```ts
export class AppComponent {
  data: any = [
    {genre: 'Sports', sold: 275},
    {genre: 'Strategy', sold: 115},
    {genre: 'Action', sold: 120},
    {genre: 'Shooter', sold: 350},
    {genre: 'Other', sold: 150},
  ];
  
  width: number = 700;
  height: number = 400;

  configure(chart: any) {
    chart.interval().position('genre*sold').color('genre');
  }
}
```
Then use it in html

```html
<g2 [data]="data" 
    [width]="width"
    [height]="height"
    (configure)="configure($event)"
></g2>
```

### Attributes

| Name | Type | Description |
| --- | --- | --- |
| [data] | Array | chart data |
| [titles]| Object | chart titles |
| [width]| number | chart width |
| [height]| number | chart height |
| [plotCfg]| Object | chart config |
| [forceFit]| boolean | fit width to parent element |
| (configure)| Function | callback to configure chart |


## License

[MIT](https://tldrlegal.com/license/mit-license) © [Vadym Yatsyuk](https://github.com/vadimdez)

---
_Source: https://npm.io/package/ngx-g2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
