Created
February 3, 2015 10:08
-
-
Save vongohren/2cc1c1fa04797ec5089d 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
componentDidMount: function() { | |
console.log(this.getDOMNode()); | |
Highcharts.setOptions({ | |
global: { | |
timezoneOffset: -1*60 | |
} | |
}) | |
var that = this; | |
var name = this.props.name; | |
plantRef = new Firebase('https://plantdata.firebaseio.com/'+name); | |
plantRef.on("value", valueUpdated.bind(this)); | |
xhr.get('/?plant='+name, function(info){ | |
var data = _.map(info, function(obj){ | |
var date = new Date(obj.inserted); | |
var value = 0 | |
value = obj.watervalue; | |
return [Date.parse(date), value]; | |
}); | |
chart = plotChart.createPlot(that.getDOMNode(),data, name); | |
}) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment