Graph plotting: only keeping most relevant data

前端 未结 3 1623
滥情空心
滥情空心 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:10

    What you are looking to do is known as downsampling or decimation. Essentially you filter the data and then drop N - 1 out of every N samples (decimation or down-sampling by factor of N). A crude filter is just taking a local moving average. E.g. if you want to decimate by a factor of N = 10 then replace every 10 points by the average of those 10 points.

    Note that with the above scheme you may lose some high frequency data from your plot (since you are effectively low pass filtering the data) - if it's important to see short term variability then an alternative approach is to plot every N points as a single vertical bar which represents the range (i.e. min..max) of those N points.

提交回复
热议问题