#
Sproutcore and Flot
Quick note for fellow dummies. When you’re trying to use Flot with SproutCore, do the following:
layerDidChange: function() {
this.set('layerNeedsUpdate', YES);
}.observes('layer'),
updateLayer: function() {
sc_super();
var layer = this.get('layer');
if (layer) $.plot(layer, this.get('data'));
}
Initially I was trying to use updateLayer as per this thread on the SproutCore Google group. The problems with width/height being 0 on the element come from trying to run the plot function before the end of the current RunLoop. Setting layerNeedsUpdate to YES steps around this, as updateLayerIfNeeded is run at the end of the current RunLoop.
This was posted 1 year ago. It has 2 notes and 0 comments.
-
aeonra liked this
-
awesomeflashgames liked this
-
colincodes posted this