Created
April 27, 2013 23:50
-
-
Save mrcwinn/5475227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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