Skip to content

Instantly share code, notes, and snippets.

@vongohren
Created February 3, 2015 10:08
Show Gist options
  • Save vongohren/2cc1c1fa04797ec5089d to your computer and use it in GitHub Desktop.
Save vongohren/2cc1c1fa04797ec5089d to your computer and use it in GitHub Desktop.
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