i have array this:   ["2011-06-16 16:37:20",23.2], ["2011-06-21 16:37:20",35.6], ["2011-06-26 16:37:20",41.8], ["2011-07-01 16:37:20",25], ["2011-07-06 16:37:20",22.8], ["2011-07-11 16:37:20",36.4], ["2011-07-16 16:37:20",34], ["2011-07-21 16:37:20",20] [...]  format: [$date,count]   now need add 3rd 4th value every array element, average of n counts before or after.   example if n=3   the 3rd value should average of 3 count-values before , 4th value should average of 3 count-values after current array element. result that:   ["2011-06-16 16:37:20",23.2, null,  34.13], ["2011-06-21 16:37:20",35.6, null,  29.86], ["2011-06-26 16:37:20",41.8, null,  28.06], ["2011-07-01 16:37:20",25,   33.53, 31.06], ["2011-07-06 16:37:20",22.8, 34.13, 30.13], ["2011-07-11 16:37:20",36.4, 29.86, null], ["2011-07-16 16:37:20",34,   28.06, null], ["2...
 
Comments
Post a Comment