Updating data depending on zoom-factor

36 views
Skip to first unread message

Johannes Vogel

unread,
Apr 16, 2015, 11:58:13 AM4/16/15
to flot-...@googlegroups.com
I have about 60 mio data points over a period of 5 years.
If I overlook the whole time, daily averages are beautiful, but if I zoom in,
I'd like to show more precisious values. My backend calculates daily and hourly
averages and saves them into the database.

Now I'd like to update my data points when I'm zooming in/out.

My problem is that Flot first get the data and calculates the grid  / graphic around them.
But when I'm zooming, I'd like to add more data depending on the grid.

Did someone else solve this problem already?
Best regards,
Johannes

Ced

unread,
Apr 16, 2015, 10:16:15 PM4/16/15
to flot-...@googlegroups.com
The trick is to switch between two data sets when the user zooms in past a certain threshold.
Since your hourly data set is quite large, you will want to load the hourly data using AJAX for only the selected range.

Here is an example:
http://jsfiddle.net/my93t64b/

Johannes Vogel

unread,
Apr 17, 2015, 8:04:52 AM4/17/15
to flot-...@googlegroups.com
Hi Ced

Thank you very much, this helped perfectly!
Best regards,
Johannes
Reply all
Reply to author
Forward
0 new messages