It may be a little late to this thread, but I used the linear regression example as a basis for this kind of thing:
http://dygraphs.com/gallery/#g/linear-regression -- walk/loop through the data, calculate the average, plot it as new series or replace existing. I'd use JavaScript in the browser to do it myself. I did this for integration (totalizing flowmeters), and for averaging (draw flat line at average), as well as slope/rate of change too (nearly duplicating the example there).
I use DyGraphs industrially, I found the jQuery plugin also worked VERY well with it, because in a chemical plant there are hundreds of 'tags', e.g. 'Asphalt tank temperature TI-123', with jQuery I can allow user to type part of tag and autocomplete, sincere there are too many to select from with a single drop-down menu. The zoom features of this package are exceptional.
If you are plotting large time series, you might want to just average during load, and then re-load only if they zoom in. In my case, I simply used IIS to lookup the data with a simple ASP script and then it renders it in DyGraphs.