Skip to content

Commit 6253c26

Browse files
authored
Merge pull request #101 from bdavi/add-custom-plugin-support
Add custom plugin support
2 parents 26748a7 + eb8852f commit 6253c26

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ $ ember install ember-cli-chart
1515
In your handlebars template just do:
1616

1717
```
18-
{{ember-chart type=CHARTTYPE data=CHARTDATA options=CHARTOPTIONS width=CHARTWIDTH height=CHARTHEIGHT}}
18+
{{ember-chart type=CHARTTYPE data=CHARTDATA options=CHARTOPTIONS width=CHARTWIDTH height=CHARTHEIGHT plugins=CHARTPLUGINS}}
1919
```
2020

2121
* CHARTTYPE: String; one of the following -- `line`, `bar`, `radar`, `polarArea`, `pie` or `doughnut`.
2222
* CHARTDATA: Array; refer to the ChartJS documentation
2323
* CHARTOPTIONS: Object; refer to the ChartJS documentation. This is optional.
2424
* CHARTWIDTH: Number; pixel width of the canvas element. Only applies if the chart is NOT responsive.
2525
* CHARTHEIGHT: Number; pixel height of the canvas element. Only applies if the chart is NOT responsive.
26+
* CHARTPLUGINS: Array; refer to ChartJS documentaion. This is optional.
2627

2728
#### Example
2829

addon/components/ember-chart.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ import Component from '@ember/component';
44
export default Component.extend({
55
tagName: 'canvas',
66
attributeBindings: ['width', 'height'],
7+
plugins: [],
78

89
didInsertElement() {
910
this._super(...arguments);
1011
let context = this.get('element');
1112
let data = this.get('data');
1213
let type = this.get('type');
1314
let options = this.get('options');
15+
let plugins = this.get('plugins');
1416

1517
let chart = new Chart(context, {
1618
type: type,
1719
data: data,
18-
options: options
20+
options: options,
21+
plugins: plugins
1922
});
2023
this.set('chart', chart);
2124
},

0 commit comments

Comments
 (0)