Graph plotting: only keeping most relevant data

前端 未结 3 1675
滥情空心
滥情空心 2021-02-06 04:03

In order to save bandwith and so as to not to have generate pictures/graphs ourselves I plan on using Google\'s charting API:

http://code.google.com/apis/chart/

3条回答
  •  遇见更好的自我
    2021-02-06 05:07

    The flot-downsample plugin for the Flot JavaScript graphing library could do what you are looking for, up to a point.

    The purpose is to try retain the visual characteristics of the original line using considerably fewer data points.

    The research behind this algorithm is documented in the author's thesis.

    Note that it doesn't work for any kind of series, and won't give meaningful results when you want a downsampling factor beyond 10, in my experience.

    The problem is that it cuts the series in windows of equal sizes then keep one point per window. Since you may have denser data in some windows than others the result is not necessarily optimal. But it's efficient (runs in linear time).

提交回复
热议问题