Adding topN query functionality to Dygraph output.