This is an Ember CLI addon for adding a ChartJS component. This addon is tested on Ember-CLI v1.13.1 and uses the ember-try
addon to test against Ember release, beta and canary.
$ ember install ember-cli-chart
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
orDoughnut
. - 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.
{{ember-chart type='Pie' data=model.chartData width=200 height=200}}
{{ember-chart type='Line' data=model.chartData width=200 height=200 legend=true}}