Skip to content

Instantly share code, notes, and snippets.

@mrcwinn
Created April 27, 2013 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrcwinn/5475227 to your computer and use it in GitHub Desktop.
Save mrcwinn/5475227 to your computer and use it in GitHub Desktop.
Mod.ChartView = Ember.View.extend({
tagName: 'canvas',
attributeBindings: ['width', 'height'],
width: '200px',
height: '200px',
didInsertElement: function() {
var project = this.get('context');
var issues = project.get('issues').toArray();
var data = [];
var closed = 0;
for(i = 0; i < issues.length; i++) {
if(issues[i].get('status') == 'closed') {
closed = closed + 1;
}
}
var data = [{
value: closed,
color: "#F38630"
}, {
value: (issues.length - closed),
color: "#CCCCCC"
}];
new Chart(this.get('element').getContext("2d")).Pie(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment