09 Jun '13, 8pm

*Ember.js and Flot Charts* by @cfcluan on the @pivotallabs blog: #emberjs

Continuing to play around with Ember.js I wanted to draw some charts. I’ve used flotcharts with great success in the past but since it’s just a jQuery plugin it is obviously unaware of ember’s amazing data binding capabilities. Flot requires you to pass in an array of datapoints every time you want to create or update a chart. You can’t use a bound variable in that array so we will have to use observers to manually update flot when our data changes. Let’s create a flot view that we can re-use in our templates: App.FlotView = Ember.View.extend({ classNames: ['canvas'], didInsertElement: function() { this.renderChart(); }, chartUpdated: function() { this.renderChart(); }.observes('controller.datasets'), renderChart: function() { var canvas = this.$(); if (canvas) { canvas.plot(this.get('controller.datasets')); } } }); We’re assuming here that this view is being added on a co...

Full article: http://pivotallabs.com/ember-js-and-flot-charts/

Tweets

IEA: Five charts on why most fossil fuels we know about will have to stay un-burned (even with CCS)

IEA: Five charts on why most fossil fuels we kn...

greenpeace.org.uk 10 Jun '13, 11am

Global greenhouse gas emissions have reached a record high, meaning the world remains on track for catastrophic climate ch...

wrote an ebook on Ember.js /cc @EmberWatch

gilesbowkett.blogspot.com 19 Jun '13, 9am

I've written a new ebook. It provides a detailed introduction to Ember.js. One enormous caveat: it doesn't deal with the d...