-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Option to peridiodically refresh #20739
Comments
A continuation of your previous question #20734, better to reopen than post a new one.
It seems refreshInterval is redundant. Code works OK without it - Demo. |
Hi @helgasoft, Yes you are absolutely correct: the And yes indeed your demo code works fine by refreshing everytime a new datapoint is appended to the chart. But imho it is a large overhead (from a performance point of view) to refresh the chart every 10 msecs (when a new datapoint arrives). This becomes even more important when the number of datapoints in the chart or the rate of appending datapoints increases further. It seems to be very inefficient to me to refresh the chart more often as your eye can see. I hope you understand my concern... Therefore I tried to reduce the number of refreshes e.g. once every 500 milliseconds (i.e. when 50 datapoints have been appended). I had expected to see every 500 milliseconds the latest 50 new datapoints to be appended to the chart, but for some reason the chart keeps flickering. I also noticed that you have used I agree with you that adding a new feature for this might be complete overhead. But it would be nice if we could refresh the chart at lower rates. If you would have any tips I could try to do this properly, that would be very much appreciated! |
You may consider collecting new data and appending it only once within your preferred interval. |
Nice catch!! I even hadn't thought myself about comparing performance to the scatter chart. Could you then please add the label "bug" to this issue then, so hopefully somebody ever finds some time to have a look a it? It would be a really nice improvement for our (open-source Node-RED) dashboard, because this is a typical use case for our users. Thanks!!
Yes you correct, that looks very smooth. And you even use
@Justin-ZS |
What problem does this feature solve?
Dear,
It seems weird to me if this feature wouldn't exist already, but cannot find anything unfortunately. Perhaps I am just searching for the wrong keywords. Apologies in that case already...
I am continiously appending new datapoints to my chart using
chart.appendData
. However calling each time thechart.resize()
(to show the new appended datapoint) is too resource extensive. So I tried a simple workaround to refresh the chart only every 500 msecs, however the updating looks very ugly, as you can see in this codepen. I have no idea what I am doing wrong... When you set therefreshInterval
to value0
in this codepen, then the chart is refreshed for every datapoint and then it looks better.What does the proposed API look like?
Perhaps add a parameter like
refreshInterval
(in msecs) orrefreshCount
(as a counter of new datapoints added) could be provided.The text was updated successfully, but these errors were encountered: