(function(){vara,b,c,d,e=function(a,b){returnfunction(){returna.apply(b,arguments)}};a=jQuery,b={},b.Line=function(){functionc(c){this.updateHilight=e(this.updateHilight,this),this.hilight=e(this.hilight,this),this.updateHover=e(this.updateHover,this),this.transY=e(this.transY,this),this.transX=e(this.transX,this);if(!(thisinstanceofb.Line))returnnewb.Line(c);typeofc.element=="string"?this.el=a(document.getElementById(c.element)):this.el=a(c.element);if(this.el===null||this.el.length===0)thrownewError("Graph placeholder not found.");this.options=a.extend({},this.defaults,c),typeofthis.options.units=="string"&&(this.options.postUnits=c.units);if(this.options.data===void0||this.options.data.length===0)return;this.el.addClass("graph-initialised"),this.precalc(),this.redraw()}returnc.name="Line",c.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],ymax:"auto",ymin:"auto 0",marginTop:25,marginRight:25,marginBottom:30,marginLeft:25,numLines:5,gridLineColor:"#aaa",gridTextColor:"#888",gridTextSize:12,gridStrokeWidth:.5,hoverPaddingX:10,hoverPaddingY:5,hoverMargin:10,hoverFillColor:"#fff",hoverBorderColor:"#ccc",hoverBorderWidth:2,hoverOpacity:.95,hoverLabelColor:"#444",hoverFontSize:12,smooth:!0,hideHover:!1,parseTime:!0,preUnits:"",postUnits:"",dateFormat:function(a){return(newDate(a)).toString()},xLabels:"auto",xLabelFormat:null},c.prototype.precalc=function(){varc,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=this;this.options.data=this.options.data.slice(0),this.options.data.sort(function(a,b){return(a[r.options.xkey]<b[r.options.xkey])-(b[r.options.xkey]<a[r.options.xkey])}),this.columnLabels=a.map(this.options.data,function(a){returna[r.options.xkey]}),this.seriesLabels=this.options.labels,this.series=[],n=this.options.ykeys;for(i=0,l=n.length;i<l;i++){f=n[i],d=[],o=this.options.data;for(j=0,m=o.length;j<m;j++)c=o[j],d.push(c[f]||null);this.series.push(d)}returnthis.options.parseTime?this.xvals=a.map(this.columnLabels,function(a){returnb.parseDate(a)}):this.xvals=function(){q=[];for(vara=p=this.columnLabels.length-1;p<=0?a<=0:a>=0;p<=0?a++:a--)q.push(a);returnq}.apply(this),this.options.parseTime&&(this.columnLabels=a.map(this.columnLabels,function(a){returntypeofa=="number"?r.options.dateFormat(a):a})),this.xmin=Math.min.apply(null,this.xvals),this.xmax=Math.max.apply(null,this.xvals),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),typeofthis.options.ymax=="string"&&this.options.ymax.slice(0,4)==="auto"&&(g=Math.max.apply(null,Array.prototype.concat.apply([],this.series)),this.options.ymax.length>5?this.options.ymax=Math.max(parseInt(this.options.ymax.slice(5),10),g):this.options.ymax=g),typeofthis.options.ymin=="string"&&this.options.ymin.slice(0,4)==="auto"&&(h=Math.min.apply(null,Array.prototype.concat.apply([],this.series)),this.options.ymin.length>5?this.options.ymin=Math.min(parseInt(this.options.ymin.slice(5),10),h):this.options.ymin=h),this.pointGrow=Raphael.animation({r:this.options.pointSize+3},25,"linear"),this.pointShrink=Raphael.animation({r:this.options.pointSize},25,"linear"),this.elementWidth=null,this.elementHeight=null,this.prevHilight=null,this.el.mousemove(function(a){returnr.updateHilight(a.pageX)}),this.options.hideHover&&this.el.mouseout(function(a){returnr.hilight(null)}),e=function(a){varb;returnb=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],r.updateHilight(b.pageX),b},this.el.bind("touchstart",e),this.el.bind("touchmove",e),this.el.bind("touchend",e)},c.prototype.calc=function(){varb,c,d,e,f,g,h,i,j=this;e=this.el.width(),b=this.el.height(),this.yInterval=(this.options.ymax-this.options.ymin)/(this.options.numLines-1),this.yInterval<1?this.precision=-parseInt(this.yInterval.toExponential().split("e")[1]):this.precision=0;if(this.elementWidth!==e||this.elementHeight!==b){this.maxYLabelWidth=Math.max(this.measureText(this.yLabelFormat(this.options.ymin),this.options.gridTextSize).width,this.measureText(this.yLabelFormat(this.options.ymax),this.options.gridTextSize).width),this.left=this.m