define(["modules/graphs/module","modules/graphs/directives/flot/FlotConfig","flot","flot-resize","flot-fillbetween","flot-orderBar","flot-pie","flot-time","flot-tooltip"],function(a,b){"use strict";return a.registerDirective("flotAutoUpdatingChart",["$timeout",function(a){return{restrict:"E",replace:!0,template:'<div class="chart"></div>',scope:{data:"="},link:function(c,d){function e(){for(g.length>0&&(g=g.slice(1));g.length<h;){var a=g.length>0?g[g.length-1]:50,b=a+10*Math.random()-5;0>b&&(b=0),b>100&&(b=100),g.push(b)}for(var c=[],d=0;d<g.length;++d)c.push([d,g[d]]);return c}function f(){k.setData([e()]),k.draw(),a(f,i)}var g=[],h=200,i=1e3;d.val(i).change(function(){var a=$(this).val();a&&!isNaN(+a)&&(i=+a,1>i&&(i=1),i>2e3&&(i=2e3),$(this).val(""+i))});var j={yaxis:{min:0,max:100},xaxis:{min:0,max:100},colors:[b.chartFourth],series:{lines:{lineWidth:1,fill:!0,fillColor:{colors:[{opacity:.4},{opacity:0}]},steps:!1}}},k=$.plot(d,[e()],j);f()}}}])});