";
-}
-this.xlabels=new Array();
-this.ylabels=new Array();
-this.isFirstRender=true;
-this.area={x:this.options.padding.left,y:this.options.padding.top,w:this.width-this.options.padding.left-this.options.padding.right,h:this.height-this.options.padding.top-this.options.padding.bottom};
-MochiKit.DOM.updateNodeAttributes(this.container,{"style":{"position":"relative","width":this.width+"px"}});
-};
-PlotKit.CanvasRenderer.prototype.render=function(){
-if(this.isIE){
-try{
-if(this.renderDelay){
-this.renderDelay.cancel();
-this.renderDelay=null;
-}
-var _166=this.element.getContext("2d");
-}
-catch(e){
-this.isFirstRender=false;
-if(this.maxTries-->0){
-this.renderDelay=MochiKit.Async.wait(this.IEDelay);
-this.renderDelay.addCallback(bind(this.render,this));
-}
-return;
-}
-}
-if(this.options.drawBackground){
-this._renderBackground();
-}
-if(this.layout.style=="bar"){
-this._renderBarChart();
-this._renderBarAxis();
-}else{
-if(this.layout.style=="pie"){
-this._renderPieChart();
-this._renderPieAxis();
-}else{
-if(this.layout.style=="line"){
-this._renderLineChart();
-this._renderLineAxis();
-}
-}
-}
-};
-PlotKit.CanvasRenderer.prototype._renderBarChartWrap=function(data,_168){
-var _169=this.element.getContext("2d");
-var _170=this.options.colorScheme.length;
-var _171=this.options.colorScheme;
-var _172=MochiKit.Base.keys(this.layout.datasets);
-var _173=_172.length;
-for(var i=0;i<_173;i++){
-var _174=_172[i];
-var _175=_171[i%_170];
-_169.save();
-_169.fillStyle=_175.toRGBString();
-if(this.options.strokeColor){
-_169.strokeStyle=this.options.strokeColor.toRGBString();
-}else{
-if(this.options.strokeColorTransform){
-_169.strokeStyle=_175[this.options.strokeColorTransform]().toRGBString();
-}
-}
-_169.lineWidth=this.options.strokeWidth;
-var _176=function(obj){
-if(obj.name==_174){
-_168(_169,obj);
-}
-};
-MochiKit.Iter.forEach(data,bind(_176,this));
-_169.restore();
-}
-};
-PlotKit.CanvasRenderer.prototype._renderBarChart=function(){
-var bind=MochiKit.Base.bind;
-var _178=function(_179,bar){
-var x=this.area.w*bar.x+this.area.x;
-var y=this.area.h*bar.y+this.area.y;
-var w=this.area.w*bar.w;
-var h=this.area.h*bar.h;
-if((w<1)||(h<1)){
-return;
-}
-if(this.options.shouldFill){
-_179.fillRect(x,y,w,h);
-}
-if(this.options.shouldStroke){
-_179.strokeRect(x,y,w,h);
-}
-};
-this._renderBarChartWrap(this.layout.bars,bind(_178,this));
-};
-PlotKit.CanvasRenderer.prototype._renderLineChart=function(){
-var _182=this.element.getContext("2d");
-var _183=this.options.colorScheme.length;
-var _184=this.options.colorScheme;
-var _185=MochiKit.Base.keys(this.layout.datasets);
-var _186=_185.length;
-var bind=MochiKit.Base.bind;
-var _187=MochiKit.Base.partial;
-for(var i=0;i<_186;i++){
-var _188=_185[i];
-var _189=_184[i%_183];
-var _190=this.options.strokeColorTransform;
-_182.save();
-_182.fillStyle=_189.toRGBString();
-if(this.options.strokeColor){
-_182.strokeStyle=this.options.strokeColor.toRGBString();
-}else{
-if(this.options.strokeColorTransform){
-_182.strokeStyle=_189[_190]().toRGBString();
-}
-}
-_182.lineWidth=this.options.strokeWidth;
-var _191=function(ctx){
-ctx.beginPath();
-ctx.moveTo(this.area.x,this.area.y+this.area.h);
-var _193=function(ctx_,_195){
-if(_195.name==_188){
-ctx_.lineTo(this.area.w*_195.x+this.area.x,this.area.h*_195.y+this.area.y);
-}
-};
-MochiKit.Iter.forEach(this.layout.points,_187(_193,ctx),this);
-ctx.lineTo(this.area.w+this.area.x,this.area.h+this.area.y);
-ctx.lineTo(this.area.x,this.area.y+this.area.h);
-ctx.closePath();
-};
-if(this.options.shouldFill){
-bind(_191,this)(_182);
-_182.fill();
-}
-if(this.options.shouldStroke){
-bind(_191,this)(_182);
-_182.stroke();
-}
-_182.restore();
-}
-};
-PlotKit.CanvasRenderer.prototype._renderPieChart=function(){
-var _196=this.element.getContext("2d");
-var _197=this.options.colorScheme.length;
-var _198=this.layout.slices;
-var _199=this.area.x+this.area.w*0.5;
-var _200=this.area.y+this.area.h*0.5;
-var _201=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);
-if(this.isIE){
-_199=parseInt(_199);
-_200=parseInt(_200);
-_201=parseInt(_201);
-}
-for(var i=0;i<_198.length;i++){
-var _202=this.options.colorScheme[i%_197];
-_196.save();
-_196.fillStyle=_202.toRGBString();
-var _203=function(){
-_196.beginPath();
-_196.moveTo(_199,_200);
-_196.arc(_199,_200,_201,_198[i].startAngle-Math.PI/2,_198[i].endAngle-Math.PI/2,false);
-_196.lineTo(_199,_200);
-_196.closePath();
-};
-if(Math.abs(_198[i].startAngle-_198[i].endAngle)>0.001){
-if(this.options.shouldFill){
-_203();
-_196.fill();
-}
-if(this.options.shouldStroke){
-_203();
-_196.lineWidth=this.options.strokeWidth;
-if(this.options.strokeColor){
-_196.strokeStyle=this.options.strokeColor.toRGBString();
-}else{
-if(this.options.strokeColorTransform){
-_196.strokeStyle=_202[this.options.strokeColorTransform]().toRGBString();
-}
-}
-_196.stroke();
-}
-}
-_196.restore();
-}
-};
-PlotKit.CanvasRenderer.prototype._renderBarAxis=function(){
-this._renderAxis();
-};
-PlotKit.CanvasRenderer.prototype._renderLineAxis=function(){
-this._renderAxis();
-};
-PlotKit.CanvasRenderer.prototype._renderAxis=function(){
-if(!this.options.drawXAxis&&!this.options.drawYAxis){
-return;
-}
-var _204=this.element.getContext("2d");
-var _205={"style":{"position":"absolute","fontSize":this.options.axisLabelFontSize+"px","zIndex":10,"color":this.options.axisLabelColor.toRGBString(),"width":this.options.axisLabelWidth+"px","overflow":"hidden"}};
-_204.save();
-_204.strokeStyle=this.options.axisLineColor.toRGBString();
-_204.lineWidth=this.options.axisLineWidth;
-if(this.options.drawYAxis){
-if(this.layout.yticks){
-var _206=function(tick){
-if(typeof (tick)=="function"){
-return;
-}
-var x=this.area.x;
-var y=this.area.y+tick[0]*this.area.h;
-_204.beginPath();
-_204.moveTo(x,y);
-_204.lineTo(x-this.options.axisTickSize,y);
-_204.closePath();
-_204.stroke();
-var _207=DIV(_205,tick[1]);
-_207.style.top=(y-this.options.axisLabelFontSize)+"px";
-_207.style.left=(x-this.options.padding.left-this.options.axisTickSize)+"px";
-_207.style.textAlign="right";
-_207.style.width=(this.options.padding.left-this.options.axisTickSize*2)+"px";
-MochiKit.DOM.appendChildNodes(this.container,_207);
-this.ylabels.push(_207);
-};
-MochiKit.Iter.forEach(this.layout.yticks,bind(_206,this));
-}
-_204.beginPath();
-_204.moveTo(this.area.x,this.area.y);
-_204.lineTo(this.area.x,this.area.y+this.area.h);
-_204.closePath();
-_204.stroke();
-}
-if(this.options.drawXAxis){
-if(this.layout.xticks){
-var _206=function(tick){
-if(typeof (dataset)=="function"){
-return;
-}
-var x=this.area.x+tick[0]*this.area.w;
-var y=this.area.y+this.area.h;
-_204.beginPath();
-_204.moveTo(x,y);
-_204.lineTo(x,y+this.options.axisTickSize);
-_204.closePath();
-_204.stroke();
-var _208=DIV(_205,tick[1]);
-_208.style.top=(y+this.options.axisTickSize)+"px";
-_208.style.left=(x-this.options.axisLabelWidth/2)+"px";
-_208.style.textAlign="center";
-_208.style.width=this.options.axisLabelWidth+"px";
-MochiKit.DOM.appendChildNodes(this.container,_208);
-this.xlabels.push(_208);
-};
-MochiKit.Iter.forEach(this.layout.xticks,bind(_206,this));
-}
-_204.beginPath();
-_204.moveTo(this.area.x,this.area.y+this.area.h);
-_204.lineTo(this.area.x+this.area.w,this.area.y+this.area.h);
-_204.closePath();
-_204.stroke();
-}
-_204.restore();
-};
-PlotKit.CanvasRenderer.prototype._renderPieAxis=function(){
-if(!this.options.drawXAxis){
-return;
-}
-if(this.layout.xticks){
-var _209=new Array();
-for(var i=0;i
Math.PI*2){
-_216=_216-Math.PI*2;
-}else{
-if(_216<0){
-_216=_216+Math.PI*2;
-}
-}
-var _217=_210+Math.sin(_216)*(_212+10);
-var _218=_211-Math.cos(_216)*(_212+10);
-var _219={"position":"absolute","zIndex":11,"width":_213+"px","fontSize":this.options.axisLabelFontSize+"px","overflow":"hidden","color":this.options.axisLabelColor.toHexString()};
-if(_216<=Math.PI*0.5){
-_219["textAlign"]="left";
-_219["verticalAlign"]="top";
-_219["left"]=_217+"px";
-_219["top"]=(_218-this.options.axisLabelFontSize)+"px";
-}else{
-if((_216>Math.PI*0.5)&&(_216<=Math.PI)){
-_219["textAlign"]="left";
-_219["verticalAlign"]="bottom";
-_219["left"]=_217+"px";
-_219["top"]=_218+"px";
-}else{
-if((_216>Math.PI)&&(_216<=Math.PI*1.5)){
-_219["textAlign"]="right";
-_219["verticalAlign"]="bottom";
-_219["left"]=(_217-_213)+"px";
-_219["top"]=_218+"px";
-}else{
-_219["textAlign"]="right";
-_219["verticalAlign"]="bottom";
-_219["left"]=(_217-_213)+"px";
-_219["top"]=(_218-this.options.axisLabelFontSize)+"px";
-}
-}
-}
-var _220=DIV({"style":_219},this.layout.xticks[i][1]);
-this.xlabels.push(_220);
-MochiKit.DOM.appendChildNodes(this.container,_220);
-}
-}
-};
-PlotKit.CanvasRenderer.prototype._renderBackground=function(){
-var _221=this.element.getContext("2d");
-_221.save();
-_221.fillStyle=this.options.backgroundColor.toRGBString();
-_221.fillRect(0,0,this.width,this.height);
-_221.restore();
-};
-PlotKit.CanvasRenderer.prototype.clear=function(){
-if(this.isIE){
-try{
-if(this.clearDelay){
-this.clearDelay.cancel();
-this.clearDelay=null;
-}
-var _222=this.element.getContext("2d");
-}
-catch(e){
-this.isFirstRender=false;
-this.clearDelay=MochiKit.Async.wait(this.IEDelay);
-this.clearDelay.addCallback(bind(this.clear,this));
-return;
-}
-}
-var _222=this.element.getContext("2d");
-_222.clearRect(0,0,this.width,this.height);
-MochiKit.Iter.forEach(this.xlabels,MochiKit.DOM.removeElement);
-MochiKit.Iter.forEach(this.ylabels,MochiKit.DOM.removeElement);
-this.xlabels=new Array();
-this.ylabels=new Array();
-};
-PlotKit.CanvasRenderer.prototype._initialiseEvents=function(){
-var _223=MochiKit.Signal.connect;
-var bind=MochiKit.Base.bind;
-_223(this.element,"onclick",bind(this.onclick,this));
-};
-PlotKit.CanvasRenderer.prototype._resolveObject=function(e){
-var x=(e.mouse().page.x-PlotKit.Base.findPosX(this.element)-this.area.x)/this.area.w;
-var y=(e.mouse().page.y-PlotKit.Base.findPosY(this.element)-this.area.y)/this.area.h;
-var _225=this.layout.hitTest(x,y);
-if(_225){
-return _225;
-}
-return null;
-};
-PlotKit.CanvasRenderer.prototype._createEventObject=function(_226,e){
-if(_226==null){
-return null;
-}
-e.chart=_226;
-return e;
-};
-PlotKit.CanvasRenderer.prototype.onclick=function(e){
-var _227=this._resolveObject(e);
-var _228=this._createEventObject(_227,e);
-if(_228!=null){
-MochiKit.Signal.signal(this,"onclick",_228);
-}
-};
-PlotKit.CanvasRenderer.prototype.onmouseover=function(e){
-var _229=this._resolveObject(e);
-var _230=this._createEventObject(_229,e);
-if(_230!=null){
-signal(this,"onmouseover",_230);
-}
-};
-PlotKit.CanvasRenderer.prototype.onmouseout=function(e){
-var _231=this._resolveObject(e);
-var _232=this._createEventObject(_231,e);
-if(_232==null){
-signal(this,"onmouseout",e);
-}else{
-signal(this,"onmouseout",_232);
-}
-};
-PlotKit.CanvasRenderer.prototype.onmousemove=function(e){
-var _233=this._resolveObject(e);
-var _234=this._createEventObject(_233,e);
-if((_233==null)&&(this.event_isinside==null)){
-return;
-}
-if((_233!=null)&&(this.event_isinside==null)){
-signal(this,"onmouseover",_234);
-}
-if((_233==null)&&(this.event_isinside!=null)){
-signal(this,"onmouseout",_234);
-}
-if((_233!=null)&&(this.event_isinside!=null)){
-signal(this,"onmousemove",_234);
-}
-this.event_isinside=_233;
-};
-PlotKit.CanvasRenderer.isSupported=function(_235){
-var _236=null;
-try{
-if(MochiKit.Base.isUndefinedOrNull(_235)){
-_236=MochiKit.DOM.CANVAS({});
-}else{
-_236=MochiKit.DOM.getElement(_235);
-}
-var _237=_236.getContext("2d");
-}
-catch(e){
-var ie=navigator.appVersion.match(/MSIE (\d\.\d)/);
-var _239=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
-if((!ie)||(ie[1]<6)||(_239)){
-return false;
-}
-return true;
-}
-return true;
-};
-PlotKit.Canvas={};
-PlotKit.Canvas.CanvasRenderer=PlotKit.CanvasRenderer;
-PlotKit.Canvas.EXPORT=["CanvasRenderer"];
-PlotKit.Canvas.EXPORT_OK=["CanvasRenderer"];
-PlotKit.Canvas.__new__=function(){
-var m=MochiKit.Base;
-m.nameFunctions(this);
-this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
-};
-PlotKit.Canvas.__new__();
-MochiKit.Base._exportSymbols(this,PlotKit.Canvas);
-
-
-DateGraphLayout=function(_1){
-PlotKit.Layout.call(this,"line",_1);
-};
-DateGraphLayout.prototype=new PlotKit.Layout();
-DateGraphLayout.prototype.evaluateWithError=function(){
-this.evaluate();
-if(!this.options.errorBars){
-return;
-}
-var i=0;
-for(var _3 in this.datasets){
-var j=0;
-var _5=this.datasets[_3];
-if(PlotKit.Base.isFuncLike(_5)){
-continue;
-}
-for(var j=0;j<_5.length;j++,i++){
-var _6=_5[j];
-var xv=parseFloat(_6[0]);
-var yv=parseFloat(_6[1]);
-if(xv==this.points[i].xval&&yv==this.points[i].yval){
-this.points[i].errorMinus=parseFloat(_6[2]);
-this.points[i].errorPlus=parseFloat(_6[3]);
-}
-}
-}
-};
-DateGraphLayout.prototype.removeAllDatasets=function(){
-delete this.datasets;
-this.datasets=new Array();
-};
-DateGraphLayout.prototype.updateOptions=function(_9){
-MochiKit.Base.update(this.options,_9?_9:{});
-};
-DateGraphCanvasRenderer=function(_10,_11,_12){
-PlotKit.CanvasRenderer.call(this,_10,_11,_12);
-this.options.shouldFill=false;
-this.options.shouldStroke=true;
-this.options.drawYGrid=true;
-this.options.drawXGrid=true;
-this.options.gridLineColor=MochiKit.Color.Color.grayColor();
-MochiKit.Base.update(this.options,_12);
-this.options.drawBackground=false;
-};
-DateGraphCanvasRenderer.prototype=new PlotKit.CanvasRenderer();
-DateGraphCanvasRenderer.prototype.render=function(){
-this._renderLineChart();
-this._renderLineAxis();
-var ctx=this.element.getContext("2d");
-if(this.options.drawYGrid){
-var _14=this.layout.yticks;
-ctx.save();
-ctx.strokeStyle=this.options.gridLineColor.toRGBString();
-ctx.lineWidth=this.options.axisLineWidth;
-for(var i=0;i<_14.length;i++){
-var x=this.area.x;
-var y=this.area.y+_14[i][0]*this.area.h;
-ctx.beginPath();
-ctx.moveTo(x,y);
-ctx.lineTo(x+this.area.w,y);
-ctx.closePath();
-ctx.stroke();
-}
-}
-if(this.options.drawXGrid){
-var _14=this.layout.xticks;
-ctx.save();
-ctx.strokeStyle=this.options.gridLineColor.toRGBString();
-ctx.lineWidth=this.options.axisLineWidth;
-for(var i=0;i<_14.length;i++){
-var x=this.area.x+_14[i][0]*this.area.w;
-var y=this.area.y+this.area.h;
-ctx.beginPath();
-ctx.moveTo(x,y);
-ctx.lineTo(x,this.area.y);
-ctx.closePath();
-ctx.stroke();
-}
-}
-};
-DateGraphCanvasRenderer.prototype._renderLineChart=function(){
-var _17=this.element.getContext("2d");
-var _18=this.options.colorScheme.length;
-var _19=this.options.colorScheme;
-var _20=MochiKit.Base.keys(this.layout.datasets);
-var _21=this.layout.options.errorBars;
-var _22=_20.length;
-var _23=MochiKit.Base.bind;
-var _24=MochiKit.Base.partial;
-var _25=function(_26){
-_26.canvasx=this.area.w*_26.x+this.area.x;
-_26.canvasy=this.area.h*_26.y+this.area.y;
-};
-MochiKit.Iter.forEach(this.layout.points,_25,this);
-var _27=function(ctx){
-for(var i=0;i<_22;i++){
-var _28=_20[i];
-var _29=_19[i%_18];
-var _30=this.options.strokeColorTransform;
-_17.save();
-_17.strokeStyle=_29.toRGBString();
-_17.lineWidth=this.options.strokeWidth;
-ctx.beginPath();
-var _31=this.layout.points[0];
-var _32=true;
-var _33=function(_34,_31){
-if(_31.name==_28){
-if(_32){
-_34.moveTo(_31.canvasx,_31.canvasy);
-}else{
-_34.lineTo(_31.canvasx,_31.canvasy);
-}
-_32=false;
-}
-};
-MochiKit.Iter.forEach(this.layout.points,_24(_33,ctx),this);
-ctx.stroke();
-}
-};
-var _35=function(ctx){
-for(var i=0;i<_22;i++){
-var _36=_20[i];
-var _37=_19[i%_18];
-var _38=this.options.strokeColorTransform;
-_17.save();
-_17.strokeStyle=_37.toRGBString();
-_17.lineWidth=this.options.strokeWidth;
-var _39=-1;
-var _40=[-1,-1];
-var _41=0;
-var _42=this.layout.yscale;
-var _43=function(_44,_45){
-_41++;
-if(_45.name==_36){
-var _46=[_45.y-_45.errorPlus*_42,_45.y+_45.errorMinus*_42];
-_46[0]=this.area.h*_46[0]+this.area.y;
-_46[1]=this.area.h*_46[1]+this.area.y;
-if(_39>=0){
-_44.moveTo(_39,_40[0]);
-_44.lineTo(_45.canvasx,_46[0]);
-_44.lineTo(_45.canvasx,_46[1]);
-_44.lineTo(_39,_40[1]);
-_44.closePath();
-}
-_40[0]=_46[0];
-_40[1]=_46[1];
-_39=_45.canvasx;
-}
-};
-var _47=_37.colorWithAlpha(0.15);
-ctx.fillStyle=_47.toRGBString();
-ctx.beginPath();
-MochiKit.Iter.forEach(this.layout.points,_24(_43,ctx),this);
-ctx.fill();
-}
-};
-if(_21){
-_23(_35,this)(_17);
-}
-_23(_27,this)(_17);
-_17.restore();
-};
-DateGraph=function(div,_49,_50,_51){
-if(arguments.length>0){
-this.__init__(div,_49,_50,_51);
-}
-};
-DateGraph.NAME="DateGraph";
-DateGraph.VERSION="1.1";
-DateGraph.__repr__=function(){
-return "["+this.NAME+" "+this.VERSION+"]";
-};
-DateGraph.toString=function(){
-return this.__repr__();
-};
-DateGraph.DEFAULT_ROLL_PERIOD=1;
-DateGraph.DEFAULT_WIDTH=480;
-DateGraph.DEFAULT_HEIGHT=320;
-DateGraph.DEFAULT_STROKE_WIDTH=1;
-DateGraph.AXIS_LINE_WIDTH=0.3;
-DateGraph.prototype.__init__=function(div,_52,_53,_54){
-this.maindiv_=div;
-this.labels_=_53;
-this.file_=_52;
-this.rollPeriod_=_54.rollPeriod||DateGraph.DEFAULT_ROLL_PERIOD;
-this.previousVerticalX_=-1;
-this.width_=parseInt(div.style.width,10);
-this.height_=parseInt(div.style.height,10);
-this.errorBars_=_54.errorBars||false;
-this.fractions_=_54.fractions||false;
-this.strokeWidth_=_54.strokeWidth||DateGraph.DEFAULT_STROKE_WIDTH;
-this.dateWindow_=_54.dateWindow||null;
-this.valueRange_=_54.valueRange||null;
-this.labelsSeparateLines=_54.labelsSeparateLines||false;
-this.labelsDiv_=_54.labelsDiv||null;
-this.labelsKMB_=_54.labelsKMB||false;
-this.minTickSize_=_54.minTickSize||0;
-this.xValueParser_=_54.xValueParser||DateGraph.prototype.dateParser;
-this.xValueFormatter_=_54.xValueFormatter||DateGraph.prototype.dateString_;
-this.xTicker_=_54.xTicker||DateGraph.prototype.dateTicker;
-this.sigma_=_54.sigma||2;
-this.wilsonInterval_=_54.wilsonInterval||true;
-this.customBars_=_54.customBars||false;
-this.attrs_=_54;
-this.labelsFromCSV_=(this.labels_==null);
-if(this.labels_==null){
-this.labels_=[];
-}
-this.clickCallback_=_54.clickCallback||null;
-this.zoomCallback_=_54.zoomCallback||null;
-this.createInterface_();
-this.layoutOptions_={"errorBars":(this.errorBars_||this.customBars_),"xOriginIsZero":false};
-MochiKit.Base.update(this.layoutOptions_,_54);
-this.setColors_(_54);
-this.layout_=new DateGraphLayout(this.layoutOptions_);
-this.renderOptions_={colorScheme:this.colors_,strokeColor:null,strokeWidth:this.strokeWidth_,axisLabelFontSize:14,axisLineWidth:DateGraph.AXIS_LINE_WIDTH};
-MochiKit.Base.update(this.renderOptions_,_54);
-this.plotter_=new DateGraphCanvasRenderer(this.hidden_,this.layout_,this.renderOptions_);
-this.createStatusMessage_();
-this.createRollInterface_();
-this.createDragInterface_();
-connect(window,"onload",this,function(e){
-this.start_();
-});
-};
-DateGraph.prototype.rollPeriod=function(){
-return this.rollPeriod_;
-};
-DateGraph.prototype.createInterface_=function(){
-var _56=this.maindiv_;
-this.graphDiv=MochiKit.DOM.DIV({style:{"width":this.width_+"px","height":this.height_+"px"}});
-appendChildNodes(_56,this.graphDiv);
-var _57=MochiKit.DOM.CANVAS;
-this.canvas_=_57({style:{"position":"absolute"},width:this.width_,height:this.height_});
-appendChildNodes(this.graphDiv,this.canvas_);
-this.hidden_=this.createPlotKitCanvas_(this.canvas_);
-connect(this.hidden_,"onmousemove",this,function(e){
-this.mouseMove_(e);
-});
-connect(this.hidden_,"onmouseout",this,function(e){
-this.mouseOut_(e);
-});
-};
-DateGraph.prototype.createPlotKitCanvas_=function(_58){
-var h=document.createElement("canvas");
-h.style.position="absolute";
-h.style.top=_58.style.top;
-h.style.left=_58.style.left;
-h.width=this.width_;
-h.height=this.height_;
-MochiKit.DOM.appendChildNodes(this.graphDiv,h);
-return h;
-};
-DateGraph.prototype.setColors_=function(_60){
-var num=this.labels_.length;
-this.colors_=[];
-if(!_60.colors){
-var sat=_60.colorSaturation||1;
-var val=_60.colorValue||0.5;
-for(var i=1;i<=num;i++){
-var hue=(1*i/(1+num));
-this.colors_.push(MochiKit.Color.Color.fromHSV(hue,sat,val));
-}
-}else{
-for(var i=0;i=10){
-_72.doZoom_(Math.min(_74,_76),Math.max(_74,_76));
-}else{
-_72.canvas_.getContext("2d").clearRect(0,0,_72.canvas_.width,_72.canvas_.height);
-}
-_74=null;
-_75=null;
-}
-});
-connect(this.hidden_,"ondblclick",this,function(_90){
-_72.dateWindow_=null;
-_72.drawGraph_(_72.rawData_);
-var _91=_72.rawData_[0][0];
-var _92=_72.rawData_[_72.rawData_.length-1][0];
-_72.zoomCallback_(_91,_92);
-});
-};
-DateGraph.prototype.drawZoomRect_=function(_93,_94,_95){
-var ctx=this.canvas_.getContext("2d");
-if(_95){
-ctx.clearRect(Math.min(_93,_95),0,Math.abs(_93-_95),this.height_);
-}
-if(_94&&_93){
-ctx.fillStyle="rgba(128,128,128,0.33)";
-ctx.fillRect(Math.min(_93,_94),0,Math.abs(_94-_93),this.height_);
-}
-};
-DateGraph.prototype.doZoom_=function(_96,_97){
-var _98=this.layout_.points;
-var _99=null;
-var _100=null;
-for(var i=0;i<_98.length;i++){
-var cx=_98[i].canvasx;
-var x=_98[i].xval;
-if(cx<_96&&(_99==null||x>_99)){
-_99=x;
-}
-if(cx>_97&&(_100==null||x<_100)){
-_100=x;
-}
-}
-if(_99==null){
-_99=_98[0].xval;
-}
-if(_100==null){
-_100=_98[_98.length-1].xval;
-}
-this.dateWindow_=[_99,_100];
-this.drawGraph_(this.rawData_);
-this.zoomCallback_(_99,_100);
-};
-DateGraph.prototype.mouseMove_=function(_102){
-var _103=_102.mouse().page.x-PlotKit.Base.findPosX(this.hidden_);
-var _104=this.layout_.points;
-var _105=-1;
-var _106=-1;
-var _107=1e+100;
-var idx=-1;
-for(var i=0;i<_104.length;i++){
-var dist=Math.abs(_104[i].canvasx-_103);
-if(dist>_107){
-break;
-}
-_107=dist;
-idx=i;
-}
-if(idx>=0){
-_105=_104[idx].xval;
-}
-if(_103>_104[_104.length-1].canvasx){
-_105=_104[_104.length-1].xval;
-}
-var _110=[];
-for(var i=0;i<_104.length;i++){
-if(_104[i].xval==_105){
-_110.push(_104[i]);
-}
-}
-var _111=3;
-var ctx=this.canvas_.getContext("2d");
-if(this.previousVerticalX_>=0){
-var px=this.previousVerticalX_;
-ctx.clearRect(px-_111-1,0,2*_111+2,this.height_);
-}
-if(_110.length>0){
-var _103=_110[0].canvasx;
-var _112=this.xValueFormatter_(_105)+":";
-var clen=this.colors_.length;
-for(var i=0;i<_110.length;i++){
-if(this.labelsSeparateLines){
-_112+="
";
-}
-var _114=_110[i];
-_112+=" "+_114.name+":"+this.round_(_114.yval,2);
-}
-this.labelsDiv_.innerHTML=_112;
-this.lastx_=_105;
-ctx.save();
-for(var i=0;i<_110.length;i++){
-ctx.beginPath();
-ctx.fillStyle=this.colors_[i%clen].toRGBString();
-ctx.arc(_103,_110[i%clen].canvasy,_111,0,360,false);
-ctx.fill();
-}
-ctx.restore();
-this.previousVerticalX_=_103;
-}
-};
-DateGraph.prototype.mouseOut_=function(_115){
-var ctx=this.canvas_.getContext("2d");
-ctx.clearRect(0,0,this.width_,this.height_);
-this.labelsDiv_.innerHTML="";
-};
-DateGraph.prototype.dateString_=function(date){
-var d=new Date(date);
-var year=""+d.getFullYear();
-var _119=""+(d.getMonth()+1);
-if(_119.length<2){
-_119="0"+_119;
-}
-var day=""+d.getDate();
-if(day.length<2){
-day="0"+day;
-}
-return year+"/"+_119+"/"+day;
-};
-DateGraph.prototype.round_=function(num,_121){
-var _122=Math.pow(10,_121);
-return Math.round(num*_122)/_122;
-};
-DateGraph.prototype.loadedEvent_=function(data){
-this.rawData_=this.parseCSV_(data);
-this.drawGraph_(this.rawData_);
-};
-DateGraph.prototype.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
-DateGraph.prototype.quarters=["Jan","Apr","Jul","Oct"];
-DateGraph.prototype.addXTicks_=function(){
-var _124,endDate;
-if(this.dateWindow_){
-_124=this.dateWindow_[0];
-endDate=this.dateWindow_[1];
-}else{
-_124=this.rawData_[0][0];
-endDate=this.rawData_[this.rawData_.length-1][0];
-}
-var _125=this.xTicker_(_124,endDate);
-this.layout_.updateOptions({xTicks:_125});
-};
-DateGraph.prototype.dateTicker=function(_126,_127){
-var _128=24*60*60*1000;
-_126=_126/_128;
-_127=_127/_128;
-var _129=_127-_126;
-var _130=[];
-var _131=false;
-var _132=1;
-if(_129>30*366){
-_131=true;
-_130=["Jan"];
-_132=10;
-}else{
-if(_129>4*366){
-_130=["Jan"];
-_131=true;
-}else{
-if(_129>366){
-_130=this.quarters;
-_131=true;
-}else{
-if(_129>40){
-_130=this.months;
-_131=true;
-}else{
-if(_129>10){
-for(var week=_126-14;week<_127+14;week+=7){
-_130.push(week*_128);
-}
-}else{
-for(var day=_126-14;day<_127+14;day+=1){
-_130.push(day*_128);
-}
-}
-}
-}
-}
-}
-var _134=[];
-if(_131){
-var _135=1900+(new Date(_126*_128)).getYear();
-var _136=1900+(new Date(_127*_128)).getYear();
-for(var i=_135;i<=_136;i++){
-if(i%_132!=0){
-continue;
-}
-for(var j=0;j<_130.length;j++){
-var date=Date.parse(_130[j]+" 1, "+i);
-_134.push({label:_130[j]+"'"+(""+i).substr(2,2),v:date});
-}
-}
-}else{
-for(var i=0;i<_130.length;i++){
-var date=new Date(_130[i]);
-var year=date.getFullYear().toString();
-var _137=this.months[date.getMonth()]+date.getDate();
-_137+="'"+year.substr(year.length-2,2);
-_134.push({label:_137,v:date});
-}
-}
-return _134;
-};
-DateGraph.prototype.numericTicks=function(minV,maxV){
-var _140;
-if(maxV<=0){
-_140=1;
-}else{
-_140=Math.pow(10,Math.floor(Math.log(maxV)/Math.log(10)));
-}
-var _141=(maxV-minV)/_140;
-while(2*_141<20){
-_141*=2;
-}
-if((maxV-minV)/_141=k*k*k){
-_144=this.round_(_143/(k*k*k),1)+"B";
-}else{
-if(_143>=k*k){
-_144=this.round_(_143/(k*k),1)+"M";
-}else{
-if(_143>=k){
-_144=this.round_(_143/k,1)+"K";
-}
-}
-}
-}
-_142.push({label:_144,v:_143});
-}
-return _142;
-};
-DateGraph.prototype.addYTicks_=function(minY,maxY){
-var _148=this.numericTicks(minY,maxY);
-this.layout_.updateOptions({yAxis:[minY,maxY],yTicks:_148});
-};
-DateGraph.prototype.drawGraph_=function(data){
-var maxY=null;
-this.layout_.removeAllDatasets();
-for(var i=1;i=low&&_149[k][0]<=high){
-_153.push(_149[k]);
-var y=bars?_149[k][1][0]:_149[k][1];
-if(maxY==null||y>maxY){
-maxY=y;
-}
-}
-}
-_149=_153;
-}else{
-for(var j=0;j<_149.length;j++){
-var y=bars?_149[j][1][0]:_149[j][1];
-if(maxY==null||y>maxY){
-maxY=bars?y+_149[j][1][1]:y;
-}
-}
-}
-if(bars){
-var vals=[];
-for(var j=0;j<_149.length;j++){
-vals[j]=[_149[j][0],_149[j][1][0],_149[j][1][1],_149[j][1][2]];
-}
-this.layout_.addDataset(this.labels_[i-1],vals);
-}else{
-this.layout_.addDataset(this.labels_[i-1],_149);
-}
-}
-if(this.valueRange_!=null){
-this.addYTicks_(this.valueRange_[0],this.valueRange_[1]);
-}else{
-maxY*=1.1;
-if(maxY<=0){
-maxY=1;
-}else{
-var _155=Math.pow(10,Math.floor(Math.log(maxY)/Math.log(10)));
-maxY=_155*Math.ceil(maxY/_155);
-}
-this.addYTicks_(0,maxY);
-}
-this.addXTicks_();
-this.layout_.evaluateWithError();
-this.plotter_.clear();
-this.plotter_.render();
-this.canvas_.getContext("2d").clearRect(0,0,this.canvas_.width,this.canvas_.height);
-};
-DateGraph.prototype.rollingAverage=function(_156,_157){
-if(_156.length<2){
-return _156;
-}
-var _157=Math.min(_157,_156.length-1);
-var _158=[];
-var _159=this.sigma_;
-if(this.fractions_){
-var num=0;
-var den=0;
-var mult=100;
-for(var i=0;i<_156.length;i++){
-num+=_156[i][1][0];
-den+=_156[i][1][1];
-if(i-_157>=0){
-num-=_156[i-_157][1][0];
-den-=_156[i-_157][1][1];
-}
-var date=_156[i][0];
-var _162=den?num/den:0;
-if(this.errorBars_){
-if(this.wilsonInterval_){
-if(den){
-var p=_162<0?0:_162,n=den;
-var pm=_159*Math.sqrt(p*(1-p)/n+_159*_159/(4*n*n));
-var _165=1+_159*_159/den;
-var low=(p+_159*_159/(2*den)-pm)/_165;
-var high=(p+_159*_159/(2*den)+pm)/_165;
-_158[i]=[date,[p*mult,(p-low)*mult,(high-p)*mult]];
-}else{
-_158[i]=[date,[0,0,0]];
-}
-}else{
-var _166=den?_159*Math.sqrt(_162*(1-_162)/den):1;
-_158[i]=[date,[mult*_162,mult*_166,mult*_166]];
-}
-}else{
-_158[i]=[date,mult*_162];
-}
-}
-}else{
-if(this.customBars_){
-for(var i=0;i<_156.length;i++){
-var data=_156[i][1];
-var y=data[1];
-_158[i]=[_156[i][0],[y,y-data[0],data[2]-y]];
-}
-}else{
-var _167=Math.min(_157-1,_156.length-2);
-if(!this.errorBars_){
-for(var i=0;i<_167;i++){
-var sum=0;
-for(var j=0;jthis.maxxval){this.maxxval=a}}}this.xrange=this.maxxval-this.minxval;this.xscale=(this.xrange!=0?1/this.xrange:1);this.minyval=this.options.yAxis[0];this.maxyval=this.options.yAxis[1];this.yrange=this.maxyval-this.minyval;this.yscale=(this.yrange!=0?1/this.yrange:1)};DygraphLayout.prototype._evaluateLineCharts=function(){this.points=new Array();for(var e in this.datasets){if(!this.datasets.hasOwnProperty(e)){continue}var d=this.datasets[e];for(var b=0;b=1){a.y=1}if((a.x>=0)&&(a.x<=1)){this.points.push(a)}}}};DygraphLayout.prototype._evaluateLineTicks=function(){this.xticks=new Array();for(var c=0;c=0)&&(d<=1)){this.xticks.push([d,a])}}this.yticks=new Array();for(var c=0;c=0)&&(d<=1)){this.yticks.push([d,a])}}};DygraphLayout.prototype.evaluateWithError=function(){this.evaluate();if(!this.options.errorBars){return}var d=0;for(var g in this.datasets){if(!this.datasets.hasOwnProperty(g)){continue}var c=0;var f=this.datasets[g];for(var c=0;c0){for(var e=0;ethis.height){k.style.bottom="0px"}else{k.style.top=h+"px"}k.style.left="0px";k.style.textAlign="right";k.style.width=this.options.yAxisLabelWidth+"px";this.container.appendChild(k);this.ylabels.push(k)}var m=this.ylabels[0];var n=this.options.axisLabelFontSize;var a=parseInt(m.style.top)+n;if(a>this.height-n){m.style.top=(parseInt(m.style.top)-n/2)+"px"}}b.beginPath();b.moveTo(this.area.x,this.area.y);b.lineTo(this.area.x,this.area.y+this.area.h);b.closePath();b.stroke()}if(this.options.drawXAxis){if(this.layout.xticks){for(var e=0;ethis.width){c=this.width-this.options.xAxisLabelWidth;k.style.textAlign="right"}if(c<0){c=0;k.style.textAlign="left"}k.style.left=c+"px";k.style.width=this.options.xAxisLabelWidth+"px";this.container.appendChild(k);this.xlabels.push(k)}}b.beginPath();b.moveTo(this.area.x,this.area.y+this.area.h);b.lineTo(this.area.x+this.area.w,this.area.y+this.area.h);b.closePath();b.stroke()}b.restore()};DygraphCanvasRenderer.prototype._renderLineChart=function(){var b=this.element.getContext("2d");var d=this.options.colorScheme.length;var n=this.options.colorScheme;var B=this.layout.options.errorBars;var q=this.layout.options.fillGraph;var D=[];for(var E in this.layout.datasets){if(this.layout.datasets.hasOwnProperty(E)){D.push(E)}}var x=D.length;for(var z=0;z=0){s.moveTo(h,f[0]);s.lineTo(t.canvasx,p[0]);s.lineTo(t.canvasx,p[1]);s.lineTo(h,f[1]);s.closePath()}f[0]=p[0];f[1]=p[1];h=t.canvasx}}s.fill()}}else{if(q){for(var z=0;z0){r=D[z-1]}var v=n[z%d];s.save();s.strokeStyle=v;s.lineWidth=this.options.strokeWidth;var h=-1;var f=[-1,-1];var k=0;var A=this.layout.yscale;var a=new RGBColor(v);var C="rgba("+a.r+","+a.g+","+a.b+",0.15)";s.fillStyle=C;s.beginPath();for(var w=0;w1){e=1}}var p=[t.y,e];p[0]=this.area.h*p[0]+this.area.y;p[1]=this.area.h*p[1]+this.area.y;if(h>=0){s.moveTo(h,f[0]);s.lineTo(t.canvasx,p[0]);s.lineTo(t.canvasx,p[1]);s.lineTo(h,f[1]);s.closePath()}f[0]=p[0];f[1]=p[1];h=t.canvasx}}s.fill()}}}for(var z=0;z0){if(arguments.length==4){this.warn("Using deprecated four-argument dygraph constructor");this.__old_init__(c,b,arguments[2],arguments[3])}else{this.__init__(c,b,a)}}};Dygraph.NAME="Dygraph";Dygraph.VERSION="1.2";Dygraph.__repr__=function(){return"["+this.NAME+" "+this.VERSION+"]"};Dygraph.toString=function(){return this.__repr__()};Dygraph.DEFAULT_ROLL_PERIOD=1;Dygraph.DEFAULT_WIDTH=480;Dygraph.DEFAULT_HEIGHT=320;Dygraph.AXIS_LINE_WIDTH=0.3;Dygraph.DEFAULT_ATTRS={highlightCircleSize:3,pixelsPerXLabel:60,pixelsPerYLabel:30,labelsDivWidth:250,labelsDivStyles:{},labelsSeparateLines:false,labelsKMB:false,labelsKMG2:false,strokeWidth:1,axisTickSize:3,axisLabelFontSize:14,xAxisLabelWidth:50,yAxisLabelWidth:50,rightGap:5,showRoller:false,xValueFormatter:Dygraph.dateString_,xValueParser:Dygraph.dateParser,xTicker:Dygraph.dateTicker,delimiter:",",sigma:2,errorBars:false,fractions:false,wilsonInterval:true,customBars:false,fillGraph:false};Dygraph.DEBUG=1;Dygraph.INFO=2;Dygraph.WARNING=3;Dygraph.ERROR=3;Dygraph.prototype.__old_init__=function(f,d,e,b){if(e!=null){var a=["Date"];for(var c=0;c=10){n.doZoom_(Math.min(b,m),Math.max(b,m))}else{n.canvas_.getContext("2d").clearRect(0,0,n.canvas_.width,n.canvas_.height)}b=null;a=null}if(e){e=false;l=null;j=null}});Dygraph.addEvent(this.hidden_,"dblclick",function(o){if(n.dateWindow_==null){return}n.dateWindow_=null;n.drawGraph_(n.rawData_);var p=n.rawData_[0][0];var q=n.rawData_[n.rawData_.length-1][0];if(n.attr_("zoomCallback")){n.attr_("zoomCallback")(p,q)}})};Dygraph.prototype.drawZoomRect_=function(c,d,b){var a=this.canvas_.getContext("2d");if(b){a.clearRect(Math.min(c,b),0,Math.abs(c-b),this.height_)}if(d&&c){a.fillStyle="rgba(128,128,128,0.33)";a.fillRect(Math.min(c,d),0,Math.abs(d-c),this.height_)}};Dygraph.prototype.doZoom_=function(g,e){var d=this.layout_.points;var f=null;var h=null;for(var c=0;cf)){f=a}if(b>e&&(h==null||ao){break}o=h;p=f}if(p>=0){l=r[p].xval}if(b>r[r.length-1].canvasx){l=r[r.length-1].xval}this.selPoints_=[];for(var f=0;f=0){var n=this.previousVerticalX_;s.clearRect(n-a-1,0,2*a+2,this.height_)}var q=function(c){return c&&!isNaN(c)};if(this.selPoints_.length>0){var b=this.selPoints_[0].canvasx;var e=this.attr_("xValueFormatter")(l,this)+":";var k=this.colors_.length;for(var f=0;f"}var m=this.selPoints_[f];var g=new RGBColor(this.colors_[f%k]);e+=" "+m.name+":"+this.round_(m.yval,2)}this.attr_("labelsDiv").innerHTML=e;this.lastx_=l;s.save();for(var f=0;f=Dygraph.DAILY){y.push({v:l,label:new Date(l+3600*1000).strftime(u)})}else{y.push({v:l,label:this.hmsString_(l)})}}}else{var f;var o=1;if(a==Dygraph.MONTHLY){f=[0,1,2,3,4,5,6,7,8,9,10,11,12]}else{if(a==Dygraph.QUARTERLY){f=[0,3,6,9]}else{if(a==Dygraph.BIANNUAL){f=[0,6]}else{if(a==Dygraph.ANNUAL){f=[0]}else{if(a==Dygraph.DECADAL){f=[0];o=10}}}}}var r=new Date(n).getFullYear();var p=new Date(k).getFullYear();var c=Dygraph.zeropad;for(var s=r;s<=p;s++){if(s%o!=0){continue}for(var q=0;qk){continue}y.push({v:l,label:new Date(l).strftime("%b %y")})}}}return y};Dygraph.dateTicker=function(a,f,d){var b=-1;for(var e=0;e=d.attr_("pixelsPerXLabel")){b=e;break}}if(b>=0){return d.GetXAxis(a,f,b)}else{}};Dygraph.numericTicks=function(v,u,l){if(l.attr_("labelsKMG2")){var f=[1,2,4,8]}else{var f=[1,2,5]}var x,p,a,q;var h=l.attr_("pixelsPerYLabel");for(var t=-10;t<50;t++){if(l.attr_("labelsKMG2")){var c=Math.pow(16,t)}else{var c=Math.pow(10,t)}for(var s=0;sh){break}}if(d>h){break}}var w=[];var r;var o=[];if(l.attr_("labelsKMB")){r=1000;o=["K","M","B","T"]}if(l.attr_("labelsKMG2")){if(r){l.warn("Setting both labelsKMB and labelsKMG2. Pick one!")}r=1024;o=["k","M","G","T"]}for(var t=0;t=0;s--,m/=r){if(b>=m){e=l.round_(g/m,1)+o[s];break}}}w.push({label:e,v:g})}return w};Dygraph.prototype.addYTicks_=function(c,b){var a=Dygraph.numericTicks(c,b,this);this.layout_.updateOptions({yAxis:[c,b],yTicks:a})};Dygraph.prototype.extremeValues_=function(d){var h=null,f=null;var b=this.attr_("errorBars")||this.attr_("customBars");if(b){for(var c=0;cg){a=g}if(ef){f=e}if(h==null||af){f=g}if(h==null||g=v&&d[m][0]<=c){g.push(d[m])}}d=g}var a=this.extremeValues_(d);var l=a[0];var h=a[1];if(!r||lq){q=h}if(f){var e=[];for(var n=0;n=0){t=0}if(b>0&&q<=0){b=0}if(this.attr_("includeZero")){if(q<0){b=0}if(r>0){t=0}}this.addYTicks_(t,b)}this.addXTicks_();this.layout_.updateOptions({dateWindow:this.dateWindow_});this.layout_.evaluateWithError();this.plotter_.clear();this.plotter_.render();this.canvas_.getContext("2d").clearRect(0,0,this.canvas_.width,this.canvas_.height)};Dygraph.prototype.rollingAverage=function(m,d){if(m.length<2){return m}var d=Math.min(d,m.length-1);var b=[];var s=this.attr_("sigma");if(this.fractions_){var k=0;var h=0;var e=100;for(var x=0;x=0){k-=m[x-d][1][0];h-=m[x-d][1][1]}var B=m[x][0];var v=h?k/h:0;if(this.attr_("errorBars")){if(this.wilsonInterval_){if(h){var t=v<0?0:v,u=h;var A=s*Math.sqrt(t*(1-t)/u+s*s/(4*u*u));var a=1+s*s/h;var F=(t+s*s/(2*h)-A)/a;var o=(t+s*s/(2*h)+A)/a;b[x]=[B,[t*e,(t-F)*e,(o-t)*e]]}else{b[x]=[B,[0,0,0]]}}else{var z=h?s*Math.sqrt(v*(1-v)/h):1;b[x]=[B,[e*v,e*z,e*z]]}}else{b[x]=[B,e*v]}}}else{if(this.attr_("customBars")){var F=0;var C=0;var o=0;var g=0;for(var x=0;x=0){var r=m[x-d];if(r[1][1]!=null&&!isNaN(r[1][1])){F-=r[1][0];C-=r[1][1];o-=r[1][2];g-=1}}b[x]=[m[x][0],[1*C/g,1*(C-F)/g,1*(o-C)/g]]}}else{var q=Math.min(d-1,m.length-2);if(!this.attr_("errorBars")){if(d==1){return m}for(var x=0;x=0||b.indexOf("/")>=0||isNaN(parseFloat(b))){a=true}else{if(b.length==8&&b>"19700101"&&b<"20371231"){a=true}}if(a){this.attrs_.xValueFormatter=Dygraph.dateString_;this.attrs_.xValueParser=Dygraph.dateParser;this.attrs_.xTicker=Dygraph.dateTicker}else{this.attrs_.xValueFormatter=function(c){return c};this.attrs_.xValueParser=function(c){return parseFloat(c)};this.attrs_.xTicker=Dygraph.numericTicks}};Dygraph.prototype.parseCSV_=function(h){var l=[];var p=h.split("\n");var b=this.attr_("delimiter");if(p[0].indexOf(b)==-1&&p[0].indexOf("\t")>=0){b="\t"}var a=0;if(this.labelsFromCSV_){a=1;this.attrs_.labels=p[0].split(b)}var c;var n=false;var d=this.attr_("labels").length;for(var g=a;g=0){this.loadedEvent_(this.file_)}else{var b=new XMLHttpRequest();var a=this;b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){a.loadedEvent_(b.responseText)}}};b.open("GET",this.file_,true);b.send(null)}}else{this.error("Unknown data format: "+(typeof this.file_))}}}}};Dygraph.prototype.updateOptions=function(a){if(a.rollPeriod){this.rollPeriod_=a.rollPeriod}if(a.dateWindow){this.dateWindow_=a.dateWindow}if(a.valueRange){this.valueRange_=a.valueRange}Dygraph.update(this.user_attrs_,a);this.labelsFromCSV_=(this.attr_("labels")==null);this.layout_.updateOptions({errorBars:this.attr_("errorBars")});if(a.file&&a.file!=this.file_){this.file_=a.file;this.start_()}else{this.drawGraph_(this.rawData_)}};Dygraph.prototype.resize=function(b,a){if((b===null)!=(a===null)){this.warn("Dygraph.resize() should be called with zero parameters or two non-NULL parameters. Pretending it was zero.");b=a=null}this.maindiv_.innerHTML="";this.attrs_.labelsDiv=null;if(b){this.maindiv_.style.width=b+"px";this.maindiv_.style.height=a+"px";this.width_=b;this.height_=a}else{this.width_=this.maindiv_.offsetWidth;this.height_=this.maindiv_.offsetHeight}this.createInterface_();this.drawGraph_(this.rawData_)};Dygraph.prototype.adjustRoll=function(a){this.rollPeriod_=a;this.drawGraph_(this.rawData_)};Dygraph.prototype.visibility=function(){if(!this.attr_("visibility")){this.attrs_.visibility=[]}while(this.attr_("visibility").length=a.length){this.warn("invalid series number in setVisibility: "+b)}else{a[b]=c;this.drawGraph_(this.rawData_)}};Dygraph.createCanvas=function(){var a=document.createElement("canvas");isIE=(/MSIE/.test(navigator.userAgent)&&!window.opera);if(isIE){a=G_vmlCanvasManager.initElement(a)}return a};Dygraph.GVizChart=function(a){this.container=a};Dygraph.GVizChart.prototype.draw=function(b,a){this.container.innerHTML="";this.date_graph=new Dygraph(this.container,b,a)};DateGraph=Dygraph;function RGBColor(g){this.ok=false;if(g.charAt(0)=="#"){g=g.substr(1,6)}g=g.replace(/ /g,"");g=g.toLowerCase();var a={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var c in a){if(g==c){g=a[c]}}var h=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(i){return[parseInt(i[1]),parseInt(i[2]),parseInt(i[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(i){return[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(i){return[parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16)]}}];for(var b=0;b255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var k=this.r.toString(16);var j=this.g.toString(16);var i=this.b.toString(16);if(k.length==1){k="0"+k}if(j.length==1){j="0"+j}if(i.length==1){i="0"+i}return"#"+k+j+i}}Date.ext={};Date.ext.util={};Date.ext.util.xPad=function(a,c,b){if(typeof(b)=="undefined"){b=10}for(;parseInt(a,10)1;b/=10){a=c.toString()+a}return a.toString()};Date.prototype.locale="en-GB";if(document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){Date.prototype.locale=document.getElementsByTagName("html")[0].lang}Date.ext.locales={};Date.ext.locales.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%T"};Date.ext.locales["en-US"]=Date.ext.locales.en;Date.ext.locales["en-US"].c="%a %d %b %Y %r %Z";Date.ext.locales["en-US"].x="%D";Date.ext.locales["en-US"].X="%r";Date.ext.locales["en-GB"]=Date.ext.locales.en;Date.ext.locales["en-AU"]=Date.ext.locales["en-GB"];Date.ext.formats={a:function(a){return Date.ext.locales[a.locale].a[a.getDay()]},A:function(a){return Date.ext.locales[a.locale].A[a.getDay()]},b:function(a){return Date.ext.locales[a.locale].b[a.getMonth()]},B:function(a){return Date.ext.locales[a.locale].B[a.getMonth()]},c:"toLocaleString",C:function(a){return Date.ext.util.xPad(parseInt(a.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(a){return Date.ext.util.xPad(parseInt(Date.ext.util.G(a)/100,10),0)},G:function(c){var e=c.getFullYear();var b=parseInt(Date.ext.formats.V(c),10);var a=parseInt(Date.ext.formats.W(c),10);if(a>b){e++}else{if(a===0&&b>=52){e--}}return e},H:["getHours","0"],I:function(b){var a=b.getHours()%12;return Date.ext.util.xPad(a===0?12:a,0)},j:function(c){var a=c-new Date(""+c.getFullYear()+"/1/1 GMT");a+=c.getTimezoneOffset()*60000;var b=parseInt(a/60000/60/24,10)+1;return Date.ext.util.xPad(b,0,100)},m:function(a){return Date.ext.util.xPad(a.getMonth()+1,0)},M:["getMinutes","0"],p:function(a){return Date.ext.locales[a.locale].p[a.getHours()>=12?1:0]},P:function(a){return Date.ext.locales[a.locale].P[a.getHours()>=12?1:0]},S:["getSeconds","0"],u:function(a){var b=a.getDay();return b===0?7:b},U:function(e){var a=parseInt(Date.ext.formats.j(e),10);var c=6-e.getDay();var b=parseInt((a+c)/7,10);return Date.ext.util.xPad(b,0)},V:function(e){var c=parseInt(Date.ext.formats.W(e),10);var a=(new Date(""+e.getFullYear()+"/1/1")).getDay();var b=c+(a>4||a<=1?0:1);if(b==53&&(new Date(""+e.getFullYear()+"/12/31")).getDay()<4){b=1}else{if(b===0){b=Date.ext.formats.V(new Date(""+(e.getFullYear()-1)+"/12/31"))}}return Date.ext.util.xPad(b,0)},w:"getDay",W:function(e){var a=parseInt(Date.ext.formats.j(e),10);var c=7-Date.ext.formats.u(e);var b=parseInt((a+c)/7,10);return Date.ext.util.xPad(b,0,10)},y:function(a){return Date.ext.util.xPad(a.getFullYear()%100,0)},Y:"getFullYear",z:function(c){var b=c.getTimezoneOffset();var a=Date.ext.util.xPad(parseInt(Math.abs(b/60),10),0);var e=Date.ext.util.xPad(b%60,0);return(b>0?"-":"+")+a+e},Z:function(a){return a.toString().replace(/^.*\(([^)]+)\)$/,"$1")},"%":function(a){return"%"}};Date.ext.aggregates={c:"locale",D:"%m/%d/%y",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"};Date.ext.aggregates.z=Date.ext.formats.z(new Date());Date.ext.aggregates.Z=Date.ext.formats.Z(new Date());Date.ext.unsupported={};Date.prototype.strftime=function(a){if(!(this.locale in Date.ext.locales)){if(this.locale.replace(/-[a-zA-Z]+$/,"") in Date.ext.locales){this.locale=this.locale.replace(/-[a-zA-Z]+$/,"")}else{this.locale="en-GB"}}var c=this;while(a.match(/%[cDhnrRtTxXzZ]/)){a=a.replace(/%([cDhnrRtTxXzZ])/g,function(e,d){var g=Date.ext.aggregates[d];return(g=="locale"?Date.ext.locales[c.locale][d]:g)})}var b=a.replace(/%([aAbBCdegGHIjmMpPSuUVwWyY%])/g,function(e,d){var g=Date.ext.formats[d];if(typeof(g)=="string"){return c[g]()}else{if(typeof(g)=="function"){return g.call(c,c)}else{if(typeof(g)=="object"&&typeof(g[0])=="string"){return Date.ext.util.xPad(c[g[0]](),g[1])}else{return d}}}});c=null;return b};
\ No newline at end of file