Skip to content
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 request: plot only newstate #73

Closed
jbbjarnason opened this issue Apr 8, 2019 · 5 comments
Closed

Feature request: plot only newstate #73

jbbjarnason opened this issue Apr 8, 2019 · 5 comments
Assignees
Labels

Comments

@jbbjarnason
Copy link

I have been trying to lowering resource usage, I have applied the settings recommended in the readme but when the dataset grows larger the resources grow rapidly.

For reference, the target which I am running this on has a CPU i.MX6Q 1GHZ (4 x ARM Cortex A9)

The data period is 10 minutes most commonly with 3 lines, 1 point each second totaling in 1800 points.

The feature which could maybe lower the cpu usage were to only plot new values. Instead of the polling mechanism, each point would have its "tail" (last value). I could implement this in my wrapper but I think this feature could be of value to others.

@nagix
Copy link
Owner

nagix commented May 27, 2019

Because this plugin is scrolling the entire chart area, all points and lines need to be redrawn when the frame is refreshed. Is your request to draw the last value only, and when it reached to the right end of the chart, to restart from the left end like ECG charts?

tenor

@nagix nagix self-assigned this May 27, 2019
@jbbjarnason
Copy link
Author

The initial thought that I had was only to reduce the drawn dataset (only storing significant points), for example, dataset = { x:[1,2,3,4,5,6,7,8,9,10], y:[1,2,3,3,3,4,5,5,5,2]} would be drawn as {x:[1,2,3,5,6,7,9,10],y:[1,2,3,3,4,5,5,2]}.

The simplest way of achieving this is to pop the value of the dataset if it is the same as the inserted value before ploting, however if this could be done internally it would most likely help others.

Your idea actually gave me a secondary idea, but I don't know if it is achievable. If the graph can be stored in segments, for example dividing the x-axis to frames (let's say 50 points for each "frame"). Both the ends, however, would require to be drawn on update. If the beginning end has 27 points the end should have 23 points. On the next update, the beginning should have 28 points and end 22 points. And so on it goes until beginning has 50 points and end 0 points, then that frame would freeze and not be drawn until it has reached the end. When the end has 0 points, it would need to fetch the last frame to draw.

Not sure if it helps but here is an example of a live graph:
image

@nagix
Copy link
Owner

nagix commented May 6, 2021

Have you tried to reduce the value of the frameRate option? It will simply reduce the number of drawings for CPU power saving.

@jbbjarnason
Copy link
Author

Yes I am using it. This is really a non-issue, since this can be easily implemented on the client side.

@nagix
Copy link
Owner

nagix commented May 14, 2021

Ok, great

@nagix nagix closed this as completed May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants