Closed hp8wvvvgnj6asjm7 closed 5 years ago
this.state = { data : { "name": "x", "columns": ["time", "value"], "points": [] } }; componentDidMount() { let i = 0; setInterval(()=>{ this.state.data.points.push( [new Date(), Math.round(Math.sin(i/10)*50+50)] ); this.state.data.points.shift(); this.setState({ data : this.state.data }); i++; }, 100);
Sorry, this was because of the new Date function =)