Skip to content

funnelcloudinc/ember-cli-echarts

Repository files navigation

Ember CLI echarts

Ember Version Build Status npm version Download Total Ember Observer Score Code Climate

An EmberJS echarts wrapper

Shout-out to @offirgolan as a lot of this was stolen from: ember-cli-nvd3 🍕 🍕 🍕

Installation

ember install ember-cli-echarts

Looking for help?

If it is a bug please open an issue on GitHub.

echarts Documentation

Before using this addon, you might want to checkout the echarts Docs

Basic Usage

All you need to get started is to specify which type of chart you want and the data it should display

{{echarts-chart options=options}}

Options

Chart Options

All chart specific options can be specified via the options property.

// Basic area chart
option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
        areaStyle: {}
    }]
};
{{echarts-chart options=options}}

Helper Actions

Currently there are two helper actions provided:

1. beforeSetup

This is called before echarts has been initialized.

beforeSetup(context, chart) {}
{{echarts-chart options=options beforeSetup=beforeSetup}}

2. afterSetup

This is called after all chart options and data have been set, as well as after the chart has been created.

afterSetup(context, chart) {}

Want to help?

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.