Files
purple-explorer/public/js/jqplot.ohlcRenderer.min.js
T
joeuhren 9912c92695 Script updates + directory structure cleanup
-Updated JQuery to v3.5.1
-Updated Bootstrap to v4.5.3
-Updated DataTables to v1.10.22
-Updated FontAwesome to v5.15.1
-Updated Chart.js to v2.9.4
-Updated flag-icon-css to v3.5.0
-All scripts now load minified
-Removed unused/unnecessary scripts (moment.js and some jqPlot plugins)
-Scripts that are not used on every page are now only loaded on pages where they are needed (jqPlot, Chart.js and flag-icon-css)
-Default website language to English
-Enable unicode support
-Removed unused images
-public directory cleanup (images directory renamed to img, javascript directory renamed to js, stylesheets directory renamed to css, themes directory moved from /public/themes to /public/css/themes, removed vendor directory and moved the important contents to the new img, css and js directories)
-Reward.pug rewritten to support Chart.js v2.9.4
-Updated README Features section
2020-12-17 20:01:50 -07:00

1 line
3.7 KiB
JavaScript

!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,l=this._plotData;if(l[0].length<5){this.renderer.hlc=!0;for(var r=0;r<l.length;r++)(l[r][2]<e.min||null==e.min)&&(e.min=l[r][2]),(l[r][1]>e.max||null==e.max)&&(e.max=l[r][1])}else for(r=0;r<l.length;r++)(l[r][3]<e.min||null==e.min)&&(e.min=l[r][3]),(l[r][2]>e.max||null==e.max)&&(e.max=l[r][2])},t.jqplot.OHLCRenderer.prototype.draw=function(o,e,l){var r,i,d,n,h,s,a,c,p=this.data,y=this._xaxis.min,u=this._xaxis.max,w=0,C=p.length,k=this._xaxis.series_u2p,f=this._yaxis.series_u2p,g=this.renderer,x=null!=l?l:{};null!=x.shadow?x.shadow:this.shadow,null!=x.fill?x.fill:this.fill,null!=x.fillAndStroke?x.fillAndStroke:this.fillAndStroke;if(g.bodyWidth=null!=x.bodyWidth?x.bodyWidth:g.bodyWidth,g.tickLength=null!=x.tickLength?x.tickLength:g.tickLength,o.save(),this.show){for(var R,_,L,m,B,b=0;b<p.length;b++)p[b][0]<y?w=b:p[b][0]<u&&(C=b+1);var W=this.gridData[C-1][0]-this.gridData[w][0],j=C-w;try{var q=Math.abs(this._xaxis.series_u2p(parseInt(this._xaxis._intervalStats[0].sortedIntervals[0].interval,10))-this._xaxis.series_u2p(0))}catch(t){q=W/j}g.candleStick?"number"==typeof g.bodyWidth?g._bodyWidth=g.bodyWidth:g._bodyWidth=Math.min(20,q/1.65):"number"==typeof g.tickLength?g._tickLength=g.tickLength:g._tickLength=Math.min(10,q/3.5);for(b=w;b<C;b++)R=k(p[b][0]),g.hlc?(_=null,L=f(p[b][1]),m=f(p[b][2]),B=f(p[b][3])):(_=f(p[b][1]),L=f(p[b][2]),m=f(p[b][3]),B=f(p[b][4])),c={},g.candleStick&&!g.hlc?(s=R-(h=g._bodyWidth)/2,B<_?(g.wickColor?c.color=g.wickColor:g.downBodyColor&&(c.color=g.upBodyColor),i=t.extend(!0,{},x,c),g.shapeRenderer.draw(o,[[R,L],[R,B]],i),g.shapeRenderer.draw(o,[[R,_],[R,m]],i),c={},d=B,n=_-B,g.fillUpBody?c.fillRect=!0:(c.strokeRect=!0,s=R-(h-=this.lineWidth)/2),g.upBodyColor&&(c.color=g.upBodyColor,c.fillStyle=g.upBodyColor),a=[s,d,h,n]):B>_?(g.wickColor?c.color=g.wickColor:g.downBodyColor&&(c.color=g.downBodyColor),i=t.extend(!0,{},x,c),g.shapeRenderer.draw(o,[[R,L],[R,_]],i),g.shapeRenderer.draw(o,[[R,B],[R,m]],i),c={},d=_,n=B-_,g.fillDownBody?c.fillRect=!0:(c.strokeRect=!0,s=R-(h-=this.lineWidth)/2),g.downBodyColor&&(c.color=g.downBodyColor,c.fillStyle=g.downBodyColor),a=[s,d,h,n]):(g.wickColor&&(c.color=g.wickColor),i=t.extend(!0,{},x,c),g.shapeRenderer.draw(o,[[R,L],[R,m]],i),(c={}).fillRect=!1,c.strokeRect=!1,s=[R-h/2,_],d=[R+h/2,B],h=null,n=null,a=[s,d]),i=t.extend(!0,{},x,c),g.shapeRenderer.draw(o,a,i)):(r=x.color,g.openColor&&(x.color=g.openColor),g.hlc||g.shapeRenderer.draw(o,[[R-g._tickLength,_],[R,_]],x),x.color=r,g.wickColor&&(x.color=g.wickColor),g.shapeRenderer.draw(o,[[R,L],[R,m]],x),x.color=r,g.closeColor&&(x.color=g.closeColor),g.shapeRenderer.draw(o,[[R,B],[R+g._tickLength,B]],x),x.color=r)}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);