text: !function(t){t.jqplot.OHLCRenderer=function(){t.jqplot.LineRenderer.call(this),this.candleStick=!1,this.tickLength="auto",this.bodyWidth="auto",this.openColor=null,this.closeColor=null,this.wickColor=null,this.fillUpBody=!1,this.fillDownBody=!0,this.upBodyColor=null,this.downBodyColor=null,this.hlc=!1,this.lineWidth=1.5,this._tickLength,this._bodyWidth},t.jqplot.OHLCRenderer.prototype=new t.jqplot.LineRenderer,t.jqplot.OHLCRenderer.prototype.constructor=t.jqplot.OHLCRenderer,t.jqplot.OHLCRenderer.prototype.init=function(o){o=o||{},this.lineWidth=o.lineWidth||1.5,t.jqplot.LineRenderer.prototype.init.call(this,o),this._type="ohlc";var e=this._yaxis._dataBounds,r=this._plotData;if(r[0].length<5){this.renderer.hlc=!0;for(var i=0;i<r.length;i++)(r[i][2]<e.min||null==e.min)&&(e.min=r[i][2]),(r[i][1]>e.max||null==e.max)&&(e.max=r[i][1])}else for(var i=0;i<r.length;i++)(r[i][3]<e.min||null==e.min)&&(e.min=r[i][3]),(r[i][2]>e.max||null==e.max)&&(e.max=r[i][2])},t.jqplot.OHLCRenderer.prototype.draw=function(o,e,r){var i,l,d,n,h,s,a,c,p,y=this.data,w=this._xaxis.min,u=this._xaxis.max,C=0,k=y.length,f=this._xaxis.series_u2p,g=this._yaxis.series_u2p,x=this.renderer,R=void 0!=r?r:{};void 0!=R.shadow?R.shadow:this.shadow,void 0!=R.fill?R.fill:this.fill,void 0!=R.fillAndStroke?R.fillAndStroke:this.fillAndStroke;if(x.bodyWidth=void 0!=R.bodyWidth?R.bodyWidth:x.bodyWidth,x.tickLength=void 0!=R.tickLength?R.tickLength:x.tickLength,o.save(),this.show){for(var _,L,v,m,B,i=0;i<y.length;i++)y[i][0]<w?C=i:y[i][0]<u&&(k=i+1);var b=this.gridData[k-1][0]-this.gridData[C][0],W=k-C;try{var j=Math.abs(this._xaxis.series_u2p(parseInt(this._xaxis._intervalStats[0].sortedIntervals[0].interval,10))-this._xaxis.series_u2p(0))}catch(t){var j=b/W}x.candleStick?"number"==typeof x.bodyWidth?x._bodyWidth=x.bodyWidth:x._bodyWidth=Math.min(20,j/1.65):"number"==typeof x.tickLength?x._tickLength=x.tickLength:x._tickLength=Math.min(10,j/3.5);for(var i=C;i<k;i++)_=f(y[i][0]),x.hlc?(L=null,v=g(y[i][1]),m=g(y[i][2]),B=g(y[i][3])):(L=g(y[i][1]),v=g(y[i][2]),m=g(y[i][3]),B=g(y[i][4])),p={},x.candleStick&&!x.hlc?(s=x._bodyWidth,a=_-s/2,B<L?(x.wickColor?p.color=x.wickColor:x.downBodyColor&&(p.color=x.upBodyColor),d=t.extend(!0,{},R,p),x.shapeRenderer.draw(o,[[_,v],[_,B]],d),x.shapeRenderer.draw(o,[[_,L],[_,m]],d),p={},n=B,h=L-B,x.fillUpBody?p.fillRect=!0:(p.strokeRect=!0,s-=this.lineWidth,a=_-s/2),x.upBodyColor&&(p.color=x.upBodyColor,p.fillStyle=x.upBodyColor),c=[a,n,s,h]):B>L?(x.wickColor?p.color=x.wickColor:x.downBodyColor&&(p.color=x.downBodyColor),d=t.extend(!0,{},R,p),x.shapeRenderer.draw(o,[[_,v],[_,L]],d),x.shapeRenderer.draw(o,[[_,B],[_,m]],d),p={},n=L,h=B-L,x.fillDownBody?p.fillRect=!0:(p.strokeRect=!0,s-=this.lineWidth,a=_-s/2),x.downBodyColor&&(p.color=x.downBodyColor,p.fillStyle=x.downBodyColor),c=[a,n,s,h]):(x.wickColor&&(p.color=x.wickColor),d=t.extend(!0,{},R,p),x.shapeRenderer.draw(o,[[_,v],[_,m]],d),p={},p.fillRect=!1,p.strokeRect=!1,a=[_-s/2,L],n=[_+s/2,B],s=null,h=null,c=[a,n]),d=t.extend(!0,{},R,p),x.shapeRenderer.draw(o,c,d)):(l=R.color,x.openColor&&(R.color=x.openColor),x.hlc||x.shapeRenderer.draw(o,[[_-x._tickLength,L],[_,L]],R),R.color=l,x.wickColor&&(R.color=x.wickColor),x.shapeRenderer.draw(o,[[_,v],[_,m]],R),R.color=l,x.closeColor&&(R.color=x.closeColor),x.shapeRenderer.draw(o,[[_,B],[_+x._tickLength,B]],R),R.color=l)}o.restore()},t.jqplot.OHLCRenderer.prototype.drawShadow=function(t,o,e){},t.jqplot.OHLCRenderer.checkOptions=function(t,o,e){e.highlighter||(e.highlighter={showMarker:!1,tooltipAxes:"y",yvalues:4,formatString:'<table class="jqplot-highlighter"><tr><td>date:</td><td>%s</td></tr><tr><td>open:</td><td>%s</td></tr><tr><td>hi:</td><td>%s</td></tr><tr><td>low:</td><td>%s</td></tr><tr><td>close:</td><td>%s</td></tr></table>'})}}(jQuery);