brancusi / ember-cli-chart

A simple ember component for adding Charts

Home Page:https://www.npmjs.org/package/ember-cli-chart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ember Chart

Build Status

This is an Ember CLI addon for adding a ChartJS component. This addon is tested on Ember-CLI v1.13.15 and uses the ember-try addon to test against Ember v1.13.12 and the latest release.

Installation

$ ember install ember-cli-chart

Usage

In your handlebars template just do:

{{ember-chart type=CHARTTYPE data=CHARTDATA options=CHARTOPTIONS width=CHARTWIDTH height=CHARTHEIGHT legend=LEGEND}}
  • CHARTTYPE: String; one of the following -- Line, Bar, Radar, PolarArea, Pie or Doughnut.
  • CHARTDATA: Array; refer to the ChartJS documentation
  • CHARTOPTIONS: Object; refer to the ChartJS documentation. This is optional.
  • CHARTWIDTH: Number; pixel width of the canvas element
  • CHARTHEIGHT: Number; pixel height of the canvas element
  • LEGEND: Boolean, true means add a legend. This is optional.

Example

{{ember-chart type='Pie' data=model.chartData width=200 height=200}}

Example with Legend

{{ember-chart type='Line' data=model.chartData width=200 height=200 legend=true}}

More Resources

About

A simple ember component for adding Charts

https://www.npmjs.org/package/ember-cli-chart

License:MIT License


Languages

Language:JavaScript 90.1%Language:HTML 9.8%Language:CSS 0.1%