NGX-ECHARTS

version downloads

ngx-echarts is an Angular(ver >= 2.x) directive for ECharts (ver >= 3.x)

Documents Github

Installation

```bash # if you use npm npm install echarts -S npm install ngx-echarts -S npm install @types/echarts -D # or if you use yarn yarn add echarts yarn add ngx-echarts yarn add @types/echarts -D ```

Import

```typescript import {{'{'}} NgxEchartsModule } from 'ngx-echarts'; @NgModule({{'{'}} imports: [ ..., NgxEchartsModule ], }) export class AppModule {{'{'}} } ```

Work with webpack

```diff // webpack.common.js new webpack.ProvidePlugin({{'{'}} ..., + echarts: "echarts" }) ```

Work with SystemJS

```diff // systemjs.config.js {{'{'}} map: {{'{'}} // ngx-echarts + 'echarts': 'npm:echarts', + 'ngx-echarts': 'npm:ngx-echarts' }, packages: {{'{'}} // ngx-echarts + echarts: {{'{'}} + defaultExtension: 'js', + main: 'dist/echarts.min.js', + meta: {{'{'}} + './*.js': {{'{'}} + format: 'global', // load this module as a global + exports: 'echarts' + } + } + }, + 'ngx-echarts': {{'{'}} + defaultExtension: 'js', + main: 'bundles/ngx-echarts.umd.js', + meta: {{'{'}} + './*.js': {{'{'}} + deps: ['echarts'] + } + } + } } } ```

Draw echarts