HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.44k stars 526 forks source link

Update only Delta data on Line graph #251

Open HarryEL65 opened 11 years ago

HarryEL65 commented 11 years ago

Hi all, I am using flotr2 as Library for displaying graphs with data in my working environment. and I thing it is a good library :-).

but I am facing a problem: I am displaying on a line graph plot of data that are sampled from different kind of sensors. My sensors are able to sample data on very high rate (1-5000 samples/sec) those samples are than transferred to the graph for display. With setInterval() method I m sending the data to the library. The data get drawn every 500ms from scratch... that means that every 500ms I am drawing my line graph with the wall accumulated data. after a few second the drawing get stuck.

Is there a way on any iteration to draw only the new data and keep the old one on the graph without redrawing it?

many thanks for your support, Harrry

cesutherland commented 10 years ago

Hey Harry, you'll want to do some pre-processing before sending the data to Flotr. Sample a statistically representative subset of your data as new data comes in. This could be done of either the entire data set (storing it as it comes in) or of just the newly arrived data. If using all the data, once you get to between 1 and 10 million points, you'll need to start throwing some away.

Hope this helps.

-Carl

On Wed, Nov 6, 2013 at 7:28 AM, HarryEL65 notifications@github.com wrote:

Hi all, I am using flotr2 as Library for displaying graphs with data in my working environment. and I thing it is a good library :-).

but I am facing a problem: I am displaying on a line graph plot of data that are sampled from different kind of sensors. My sensors are able to sample data on very high rate (1-5000 samples/sec) those samples are than transferred to the graph for display. With setInterval() method I m sending the data to the library. The data get drawn every 500ms from scratch... that means that every 500ms I am drawing my line graph with the wall accumulated data. after a few second the drawing get stuck.

Is there a way on any iteration to draw only the new data and keep the old one on the graph without redrawing it?

many thanks for your support, Harrry

— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/251 .