0

I am showing a graph on HTML5 canvas using the flot charting library for a between a start date and an end date. It's fine as long as the period is less than a year or so but if the user selects a big time period I will have to send large dataset and have browser process it every now and then. We have data points on daily basis.

What would be a good approach to solve an issue like this ? I am guessing it will require some normalization of data and rejecting certain datapoints based on how long the time period is.

Or I should restrict user to a max time period range ?

asked Aug 5, 2015 at 8:04
1
  • 2
    Would maybe depend on type of data and how it's displayed. Would not make much sense to send data if the user can't view it anyway. Otherwise limit to data points or calculate median/average for certain time slices like weeks or months if that makes sense for your use case. Also limiting what the user can select would be applicable if this doesn't infer with the work they do. Again there is no general rule. Commented Aug 5, 2015 at 8:26

2 Answers 2

2

You can pre-compute the statistic you want to show for each date. Then you just send the user 360*years data points, which are few enough for the slowest computer.

answered Sep 11, 2015 at 8:46
1

If I understood well, you want to keep the number of your data points (for consideration) bounded under a computation-friendly threshold, including in the case of long periods of time, yet have your charting "pretend" as if it had processed many more / all of them. In that case, this might be a good use case for picking some type of interpolation method over your discrete input set.

'Hope this helps.

answered Sep 11, 2015 at 8:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.