You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to update a chart of type Area in realtime (every second).
This is the piece of code,
// This is a simulated version of the updates// This will eventually come from a streaming API.functiongenerateNewEntry(previousEntry){// Define the time incrementconstoneDay=24*60*60*1000// Generate a new timestampconstnewTimestamp=previousEntry[0]+oneDay// Generate variationconstvariation=(Math.random()-0.5)*0.5// +/- 0.25 variationconstnewValue=previousEntry[1]+variation// Return the new entry as an array [timestamp, value]return[newTimestamp,parseFloat(newValue.toFixed(2))]}setInterval(function(){constpe=data[data.length-1];constnewEntry=generateNewEntry(pe);chart.appendData([{data: [newEntry]}])},1000)
Screen.Recording.2024-07-30.at.9.44.53.AM.mov
The problem is the "white wave" on every re-render. Any pointers or leads to fix this would be great.
I'll update this with a reproducable codesandbox link soon.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm looking to update a chart of type
Area
in realtime (every second).This is the piece of code,
Screen.Recording.2024-07-30.at.9.44.53.AM.mov
The problem is the "white wave" on every re-render. Any pointers or leads to fix this would be great.
I'll update this with a reproducable codesandbox link soon.
Beta Was this translation helpful? Give feedback.
All reactions