diff --git a/frontend/javascripts/jqplot/excanvas.min.js b/frontend/javascripts/jqplot/excanvas.min.js deleted file mode 100644 index 896786e..0000000 --- a/frontend/javascripts/jqplot/excanvas.min.js +++ /dev/null @@ -1 +0,0 @@ -if(!document.createElement("canvas").getContext){(function(){var Y=Math;var q=Y.round;var o=Y.sin;var B=Y.cos;var H=Y.abs;var N=Y.sqrt;var d=10;var f=d/2;function A(){return this.context_||(this.context_=new D(this))}var v=Array.prototype.slice;function g(j,m,p){var i=v.call(arguments,2);return function(){return j.apply(m,i.concat(v.call(arguments)))}}function ad(i){return String(i).replace(/&/g,"&").replace(/"/g,""")}function R(j){if(!j.namespaces.g_vml_){j.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!j.namespaces.g_o_){j.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))}},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}function F(j){var ae,Z=1;j=String(j);if(j.charAt(0)=="#"){ae=j}else{if(/^rgb/.test(j)){var p=M(j);var ae="#",af;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){af=Math.floor(c(p[m])*255)}else{af=Number(p[m])}ae+=n[u(af,0,255)]}Z=p[3]}else{if(/^hsl/.test(j)){var p=M(j);ae=I(p);Z=p[3]}else{ae=b[j]||j}}}return{color:ae,alpha:Z}}var r={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||r.style,variant:m.fontVariant||r.variant,weight:m.fontWeight||r.weight,size:m.fontSize||r.size,family:m.fontFamily||r.family}}function w(m,j){var i={};for(var af in m){i[af]=m[af]}var ae=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ae*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ae/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=ae*(4/3)*Z}else{i.size=ae}}}}}i.size*=0.981;return i}function aa(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}function S(i){switch(i){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function D(j){this.m_=C();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=j;var i=j.ownerDocument.createElement("div");i.style.width=j.clientWidth+"px";i.style.height=j.clientHeight+"px";i.style.overflow="hidden";i.style.position="absolute";j.appendChild(i);this.element_=i;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var t=D.prototype;t.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};t.beginPath=function(){this.currentPath_=[]};t.moveTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};t.lineTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};t.bezierCurveTo=function(m,j,ai,ah,ag,ae){var i=this.getCoords_(ag,ae);var af=this.getCoords_(m,j);var Z=this.getCoords_(ai,ah);K(this,af,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}t.quadraticCurveTo=function(ag,m,j,i){var af=this.getCoords_(ag,m);var ae=this.getCoords_(j,i);var ah={x:this.currentX_+2/3*(af.x-this.currentX_),y:this.currentY_+2/3*(af.y-this.currentY_)};var Z={x:ah.x+(ae.x-this.currentX_)/3,y:ah.y+(ae.y-this.currentY_)/3};K(this,ah,Z,ae)};t.arc=function(aj,ah,ai,ae,j,m){ai*=d;var an=m?"at":"wa";var ak=aj+B(ae)*ai-f;var am=ah+o(ae)*ai-f;var i=aj+B(j)*ai-f;var al=ah+o(j)*ai-f;if(ak==i&&!m){ak+=0.125}var Z=this.getCoords_(aj,ah);var ag=this.getCoords_(ak,am);var af=this.getCoords_(i,al);this.currentPath_.push({type:an,x:Z.x,y:Z.y,radius:ai,xStart:ag.x,yStart:ag.y,xEnd:af.x,yEnd:af.y})};t.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};t.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};t.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};t.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};t.createRadialGradient=function(p,ae,m,j,Z,i){var af=new U("gradientradial");af.x0_=p;af.y0_=ae;af.r0_=m;af.x1_=j;af.y1_=Z;af.r1_=i;return af};t.drawImage=function(ao,m){var ah,af,aj,aw,am,ak,aq,ay;var ai=ao.runtimeStyle.width;var an=ao.runtimeStyle.height;ao.runtimeStyle.width="auto";ao.runtimeStyle.height="auto";var ag=ao.width;var au=ao.height;ao.runtimeStyle.width=ai;ao.runtimeStyle.height=an;if(arguments.length==3){ah=arguments[1];af=arguments[2];am=ak=0;aq=aj=ag;ay=aw=au}else{if(arguments.length==5){ah=arguments[1];af=arguments[2];aj=arguments[3];aw=arguments[4];am=ak=0;aq=ag;ay=au}else{if(arguments.length==9){am=arguments[1];ak=arguments[2];aq=arguments[3];ay=arguments[4];ah=arguments[5];af=arguments[6];aj=arguments[7];aw=arguments[8]}else{throw Error("Invalid number of arguments")}}}var ax=this.getCoords_(ah,af);var p=aq/2;var j=ay/2;var av=[];var i=10;var ae=10;av.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",av.join(""))};t.stroke=function(aj){var ah=[];var Z=false;var m=10;var ak=10;ah.push("ai.x){ai.x=j.x}if(ae.y==null||j.yai.y){ai.y=j.y}}}ah.push(' ">');if(!aj){y(this,ah)}else{G(this,ah,ae,ai)}ah.push("");this.element_.insertAdjacentHTML("beforeEnd",ah.join(""))};function y(m,ae){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ae.push("')}function G(ao,ag,aI,ap){var ah=ao.fillStyle;var az=ao.arcScaleX_;var ay=ao.arcScaleY_;var j=ap.x-aI.x;var p=ap.y-aI.y;if(ah instanceof U){var al=0;var aD={x:0,y:0};var av=0;var ak=1;if(ah.type_=="gradient"){var aj=ah.x0_/az;var m=ah.y0_/ay;var ai=ah.x1_/az;var aK=ah.y1_/ay;var aH=ao.getCoords_(aj,m);var aG=ao.getCoords_(ai,aK);var ae=aG.x-aH.x;var Z=aG.y-aH.y;al=Math.atan2(ae,Z)*180/Math.PI;if(al<0){al+=360}if(al<0.000001){al=0}}else{var aH=ao.getCoords_(ah.x0_,ah.y0_);aD={x:(aH.x-aI.x)/j,y:(aH.y-aI.y)/p};j/=az*d;p/=ay*d;var aB=Y.max(j,p);av=2*ah.r0_/aB;ak=2*ah.r1_/aB-av}var at=ah.colors_;at.sort(function(aL,i){return aL.offset-i.offset});var an=at.length;var ar=at[0].color;var aq=at[an-1].color;var ax=at[0].alpha*ao.globalAlpha;var aw=at[an-1].alpha*ao.globalAlpha;var aC=[];for(var aF=0;aF')}else{if(ah instanceof T){if(j&&p){var af=-aI.x;var aA=-aI.y;ag.push("')}}else{var aJ=F(ao.fillStyle);var au=aJ.color;var aE=aJ.alpha*ao.globalAlpha;ag.push('')}}}t.fill=function(){this.stroke(true)};t.closePath=function(){this.currentPath_.push({type:"close"})};t.getCoords_=function(p,j){var i=this.m_;return{x:d*(p*i[0][0]+j*i[1][0]+i[2][0])-f,y:d*(p*i[0][1]+j*i[1][1]+i[2][1])-f}};t.save=function(){var i={};x(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(C(),this.m_)};t.restore=function(){if(this.aStack_.length){x(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function k(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function X(j,i,p){if(!k(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}t.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];X(this,J(i,this.m_),false)};t.rotate=function(j){var p=B(j);var m=o(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];X(this,J(i,this.m_),false)};t.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];X(this,J(i,this.m_),true)};t.transform=function(Z,p,af,ae,j,i){var m=[[Z,p,0],[af,ae,0],[j,i,1]];X(this,J(m,this.m_),true)};t.setTransform=function(ae,Z,ag,af,p,j){var i=[[ae,Z,0],[ag,af,0],[p,j,1]];X(this,i,true)};t.drawText_=function(ak,ai,ah,an,ag){var am=this.m_,aq=1000,j=0,ap=aq,af={x:0,y:0},ae=[];var i=w(E(this.font),this.element_);var p=aa(i);var ar=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=ar.direction=="ltr"?"right":"left";break;case"start":Z=ar.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":af.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":af.y=-i.size/2.25;break}switch(Z){case"right":j=aq;ap=0.05;break;case"center":j=ap=aq/2;break}var ao=this.getCoords_(ai+af.x,ah+af.y);ae.push('');if(ag){y(this,ae)}else{G(this,ae,{x:-j,y:0},{x:ap,y:i.size})}var al=am[0][0].toFixed(3)+","+am[1][0].toFixed(3)+","+am[0][1].toFixed(3)+","+am[1][1].toFixed(3)+",0,0";var aj=q(ao.x/d)+","+q(ao.y/d);ae.push('','','');this.element_.insertAdjacentHTML("beforeEnd",ae.join(""))};t.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};t.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};t.measureText=function(m){if(!this.textMeasureEl_){var i='';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};t.clip=function(){};t.arcTo=function(){};t.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var W=P.prototype=new Error;W.INDEX_SIZE_ERR=1;W.DOMSTRING_SIZE_ERR=2;W.HIERARCHY_REQUEST_ERR=3;W.WRONG_DOCUMENT_ERR=4;W.INVALID_CHARACTER_ERR=5;W.NO_DATA_ALLOWED_ERR=6;W.NO_MODIFICATION_ALLOWED_ERR=7;W.NOT_FOUND_ERR=8;W.NOT_SUPPORTED_ERR=9;W.INUSE_ATTRIBUTE_ERR=10;W.INVALID_STATE_ERR=11;W.SYNTAX_ERR=12;W.INVALID_MODIFICATION_ERR=13;W.NAMESPACE_ERR=14;W.INVALID_ACCESS_ERR=15;W.VALIDATION_ERR=16;W.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P})()}; \ No newline at end of file diff --git a/frontend/javascripts/jqplot/jquery.jqplot.min.js b/frontend/javascripts/jqplot/jquery.jqplot.min.js deleted file mode 100644 index 7b2adb0..0000000 --- a/frontend/javascripts/jqplot/jquery.jqplot.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * Although not required, the author would appreciate an email letting him - * know of any substantial use of jqPlot. You can reach the author at: - * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - */ -(function(h){var c;h.jqplot=function(A,y,w){var x,v;if(y==null){throw"No data specified"}if(y.constructor==Array&&y.length==0||y[0].constructor!=Array){throw"Improper Data Array"}if(w==null){if(y instanceof Array){x=y;v=null}else{if(y.constructor==Object){x=null;v=y}}}else{x=y;v=w}var z=new n();z.init(A,x,v);z.draw();return z};h.jqplot.debug=1;h.jqplot.config={debug:1,enablePlugins:true,defaultHeight:300,defaultWidth:400};h.jqplot.enablePlugins=h.jqplot.config.enablePlugins;h.jqplot.preInitHooks=[];h.jqplot.postInitHooks=[];h.jqplot.preParseOptionsHooks=[];h.jqplot.postParseOptionsHooks=[];h.jqplot.preDrawHooks=[];h.jqplot.postDrawHooks=[];h.jqplot.preDrawSeriesHooks=[];h.jqplot.postDrawSeriesHooks=[];h.jqplot.preDrawLegendHooks=[];h.jqplot.addLegendRowHooks=[];h.jqplot.preSeriesInitHooks=[];h.jqplot.postSeriesInitHooks=[];h.jqplot.preParseSeriesOptionsHooks=[];h.jqplot.postParseSeriesOptionsHooks=[];h.jqplot.eventListenerHooks=[];h.jqplot.preDrawSeriesShadowHooks=[];h.jqplot.postDrawSeriesShadowHooks=[];h.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};h.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};h.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};h.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};h.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};h.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};h.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};h.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function l(v){h.jqplot.ElemContainer.call(this);this.name=v;this._series=[];this.show=false;this.tickRenderer=h.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=h.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=h.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this._dataBounds={min:null,max:null};this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null}l.prototype=new h.jqplot.ElemContainer();l.prototype.constructor=l;l.prototype.init=function(){this.renderer=new this.renderer();this.tickOptions.axis=this.name;if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};l.prototype.draw=function(v){return this.renderer.draw.call(this,v)};l.prototype.set=function(){this.renderer.set.call(this)};l.prototype.pack=function(w,v){if(this.show){this.renderer.pack.call(this,w,v)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};l.prototype.reset=function(){this.renderer.reset.call(this)};l.prototype.resetScale=function(){this.min=null;this.max=null;this.numberTicks=null;this.tickInterval=null};function b(v){h.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.xoffset=12;this.yoffset=12;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=h.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.escapeHtml=false;this._series=[];h.extend(true,this,v)}b.prototype=new h.jqplot.ElemContainer();b.prototype.constructor=b;b.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};b.prototype.draw=function(w){for(var v=0;v0){D._prevPlotData=this.series[E-1]._plotData}D._sumy=0;D._sumx=0;for(C=D.data.length-1;C>-1;C--){D._sumy+=D.data[C][1];D._sumx+=D.data[C][0]}};this.getNextSeriesColor=(function(A){var z=0;var B=A.seriesColors;return function(){if(z0;D--){z=this.axes[C[D-1]];if(z.show){A[D-1]=H;H+=z.getWidth()}}if(H>this._gridPadding.right){this._gridPadding.right=H}if(this.title.show&&this.axes.x2axis.show){this._gridPadding.top=this.title.getHeight()+this.axes.x2axis.getHeight()}else{if(this.title.show){this._gridPadding.top=this.title.getHeight()}else{if(this.axes.x2axis.show){this._gridPadding.top=this.axes.x2axis.getHeight()}}}if(this.axes.xaxis.show){this._gridPadding.bottom=this.axes.xaxis.getHeight()}this.axes.xaxis.pack({position:"absolute",bottom:0,left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});this.axes.yaxis.pack({position:"absolute",top:0,left:0,height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.axes.x2axis.pack({position:"absolute",top:this.title.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(F=8;F>0;F--){this.axes[C[F-1]].pack({position:"absolute",top:0,right:A[F-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}this.target.append(this.grid.createElement(this._gridPadding));this.grid.draw();for(F=0;F0;A--){var B=E[A-1];if(z[B].show){D[B]=z[B].series_p2u(F[B.charAt(0)])}}return({offsets:C,gridPos:F,dataPos:D})}function x(F,J,I){var G=null;var K,D,B,H,C,A;var E;for(var D=0;D=p[0]-A._bodyWidth/2&&J<=p[0]+A._bodyWidth/2&&I>=z(K.data[C][2])&&I<=z(K.data[C][3])){G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}else{if(!A.hlc){var z=K._yaxis.series_u2p;if(J>=p[0]-A._tickLength&&J<=p[0]+A._tickLength&&I>=z(K.data[C][2])&&I<=z(K.data[C][3])){G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}else{var z=K._yaxis.series_u2p;if(J>=p[0]-A._tickLength&&J<=p[0]+A._tickLength&&I>=z(K.data[C][1])&&I<=z(K.data[C][2])){G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}}}else{H=Math.sqrt((J-p[0])*(J-p[0])+(I-p[1])*(I-p[1]));if(H<=E&&(H<=B||B==null)){B=H;G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}}}}return G}this.onClick=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotClick",[z.gridPos,z.dataPos,B,C])};this.onDblClick=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotDblClick",[z.gridPos,z.dataPos,B,C])};this.onMouseDown=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotMouseDown",[z.gridPos,z.dataPos,B,C])};this.onMouseUp=function(A){var z=w(A);A.data.plot.eventCanvas._elem.trigger("jqplotMouseUp",[z.gridPos,z.dataPos,null,A.data.plot])};this.onMouseMove=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotMouseMove",[z.gridPos,z.dataPos,B,C])};this.onMouseEnter=function(A){var z=w(A);var B=A.data.plot;A.data.plot.eventCanvas._elem.trigger("jqplotMouseEnter",[z.gridPos,z.dataPos,null,B])};this.onMouseLeave=function(A){var z=w(A);var B=A.data.plot;A.data.plot.eventCanvas._elem.trigger("jqplotMouseLeave",[z.gridPos,z.dataPos,null,B])};this.drawSeries=function(B,z){var D,C,A;if(z!=c){C=this.series[z];A=C.shadowCanvas._ctx;A.clearRect(0,0,A.canvas.width,A.canvas.height);C.drawShadow(A,B,this);A=C.canvas._ctx;A.clearRect(0,0,A.canvas.width,A.canvas.height);C.draw(A,B,this)}else{for(D=0;D0){return w[v--]}else{v=w.length-1;return w[v]}};this.get=function(x){return w[x]};this.setColors=function(x){w=x};this.reset=function(){v=0}};h.jqplot.hex2rgb=function(x,v){x=x.replace("#","");if(x.length==3){x=x[0]+x[0]+x[1]+x[1]+x[2]+x[2]}var w;w="rgba("+parseInt(x.slice(0,2),16)+", "+parseInt(x.slice(2,4),16)+", "+parseInt(x.slice(4,6),16);if(v){w+=", "+v}w+=")";return w};h.jqplot.rgb2hex=function(z){var x=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var v=z.match(x);var y="#";for(i=1;i<4;i++){var w;if(v[i].search(/%/)!=-1){w=parseInt(255*v[i]/100,10).toString(16);if(w.length==1){w="0"+w}}else{w=parseInt(v[i],10).toString(16);if(w.length==1){w="0"+w}}y+=w}return y};h.jqplot.normalize2rgb=function(w,v){if(w.search(/^ *rgba?\(/)!=-1){return w}else{if(w.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return h.jqplot.hex2rgb(w,v)}else{throw"invalid color spec"}}};h.jqplot.getColorComponents=function(z){var y=h.jqplot.normalize2rgb(z);var x=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var v=y.match(x);var w=[];for(i=1;i<4;i++){if(v[i].search(/%/)!=-1){w[i-1]=parseInt(255*v[i]/100,10)}else{w[i-1]=parseInt(v[i],10)}}w[3]=parseFloat(v[4])?parseFloat(v[4]):1;return w};h.jqplot.log=function(){if(window.console&&h.jqplot.debug){if(arguments.length==1){console.log(arguments[0])}else{console.log(arguments)}}};var f=h.jqplot.log;h.jqplot.AxisLabelRenderer=function(v){h.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this._elem;this.escapeHTML=false;h.extend(true,this,v)};h.jqplot.AxisLabelRenderer.prototype=new h.jqplot.ElemContainer();h.jqplot.AxisLabelRenderer.prototype.constructor=h.jqplot.AxisLabelRenderer;h.jqplot.AxisLabelRenderer.prototype.init=function(v){h.extend(true,this,v)};h.jqplot.AxisLabelRenderer.prototype.draw=function(){this._elem=h('
');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}return this._elem};h.jqplot.AxisLabelRenderer.prototype.pack=function(){};h.jqplot.AxisTickRenderer=function(v){h.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label="";this.value=null;this._styles={};this.formatter=h.jqplot.DefaultTickFormatter;this.formatString="";this.fontFamily;this.fontSize;this.textColor;this._elem;h.extend(true,this,v)};h.jqplot.AxisTickRenderer.prototype.init=function(v){h.extend(true,this,v)};h.jqplot.AxisTickRenderer.prototype=new h.jqplot.ElemContainer();h.jqplot.AxisTickRenderer.prototype.constructor=h.jqplot.AxisTickRenderer;h.jqplot.AxisTickRenderer.prototype.setTick=function(v,x,w){this.value=v;this.axis=x;if(w){this.isMinorTick=true}return this};h.jqplot.AxisTickRenderer.prototype.draw=function(){if(!this.label){this.label=this.formatter(this.formatString,this.value)}style='style="position:absolute;';if(Number(this.label)){style+="white-space:nowrap;"}style+='"';this._elem=h("
'+this.label+"
");for(var v in this._styles){this._elem.css(v,this._styles[v])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};h.jqplot.DefaultTickFormatter=function(v,w){if(typeof w=="number"){if(!v){v="%.1f"}return h.jqplot.sprintf(v,w)}else{return String(w)}};h.jqplot.AxisTickRenderer.prototype.pack=function(){};h.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new h.jqplot.ShadowRenderer()};h.jqplot.CanvasGridRenderer.prototype.init=function(w){this._ctx;h.extend(true,this,w);var v={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false};this.renderer.shadowRenderer.init(v)};h.jqplot.CanvasGridRenderer.prototype.createElement=function(){var y=document.createElement("canvas");var v=this._plotDimensions.width;var x=this._plotDimensions.height;y.width=v;y.height=x;this._elem=h(y);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});if(h.browser.msie){window.G_vmlCanvasManager.init_(document)}if(h.browser.msie){y=window.G_vmlCanvasManager.initElement(y)}this._top=this._offsets.top;this._bottom=x-this._offsets.bottom;this._left=this._offsets.left;this._right=v-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;return this._elem};h.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var L=this._ctx;var E=this._axes;L.save();L.fillStyle=this.background;L.fillRect(this._left,this._top,this._width,this._height);if(this.drawGridlines){L.save();L.lineJoin="miter";L.lineCap="butt";L.lineWidth=this.gridLineWidth;L.strokeStyle=this.gridLineColor;var G,D;var v=["xaxis","yaxis","x2axis","y2axis"];for(var A=4;A>0;A--){var w=v[A-1];var y=E[w];var H=y._ticks;if(y.show){for(var z=H.length;z>0;z--){var K=H[z-1];if(K.show){var F=Math.round(y.u2p(K.value))+0.5;switch(w){case"xaxis":if(K.showGridline){C(F,this._top,F,this._bottom)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._bottom;D=this._bottom+s;break;case"inside":G=this._bottom-s;D=this._bottom;break;case"cross":G=this._bottom-s;D=this._bottom+s;break;default:G=this._bottom;D=this._bottom+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[F,G],[F,D]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}C(F,G,F,D)}break;case"yaxis":if(K.showGridline){C(this._right,F,this._left,F)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._left-s;D=this._left;break;case"inside":G=this._left;D=this._left+s;break;case"cross":G=this._left-s;D=this._left+s;break;default:G=this._left-s;D=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[G,F],[D,F]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}C(G,F,D,F,{strokeStyle:y.borderColor})}break;case"x2axis":if(K.showGridline){C(F,this._bottom,F,this._top)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._top-s;D=this._top;break;case"inside":G=this._top;D=this._top+s;break;case"cross":G=this._top-s;D=this._top+s;break;default:G=this._top-s;D=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[F,G],[F,D]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}C(F,G,F,D)}break;case"y2axis":if(K.showGridline){C(this._left,F,this._right,F)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._right;D=this._right+s;break;case"inside":G=this._right-s;D=this._right;break;case"cross":G=this._right-s;D=this._right+s;break;default:G=this._right;D=this._right+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[G,F],[D,F]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}C(G,F,D,F,{strokeStyle:y.borderColor})}break;default:break}}}}}v=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];for(var A=7;A>0;A--){var y=E[v[A-1]];var H=y._ticks;if(y.show){var J=H[y.numberTicks-1];var B=H[0];var x=y.getLeft();var I=[[x,J.getTop()+J.getHeight()/2],[x,B.getTop()+B.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(L,I,{lineCap:"butt",fill:false,closePath:false})}C(I[0][0],I[0][1],I[1][0],I[1][1],{lineCap:"butt",strokeStyle:y.borderColor,lineWidth:y.borderWidth});for(var z=H.length;z>0;z--){var K=H[z-1];s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;if(K.showMark&&K.mark){switch(m){case"outside":G=x;D=x+s;break;case"inside":G=x-s;D=x;break;case"cross":G=x-s;D=x+s;break;default:G=x;D=x+s;break}I=[[G,F],[D,F]];if(this.shadow){this.renderer.shadowRenderer.draw(L,I,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}C(G,F,D,F,{strokeStyle:y.borderColor})}}}}L.restore()}function C(Q,P,N,M,O){L.save();O=O||{};h.extend(true,L,O);L.beginPath();L.moveTo(Q,P);L.lineTo(N,M);L.stroke();L.restore()}if(this.shadow){var I=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(L,I)}C(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:E.x2axis.borderColor,lineWidth:E.x2axis.borderWidth});C(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:E.y2axis.borderColor,lineWidth:E.y2axis.borderWidth});C(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:E.xaxis.borderColor,lineWidth:E.xaxis.borderWidth});C(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:E.yaxis.borderColor,lineWidth:E.yaxis.borderWidth});L.restore()};var r=24*60*60*1000;var j=function(v,w){v=String(v);while(v.length0?"floor":"ceil"](v/12));var w=x.getMonth()+(v%12);if(w==12){w=0;x.setYear(x.getFullYear()+1)}else{if(w==-1){w=11;x.setYear(x.getFullYear()-1)}}x.setMonth(w)},diff:function(z,x){var v=z.getFullYear()-x.getFullYear();var w=z.getMonth()-x.getMonth()+(v*12);var y=z.getDate()-x.getDate();return w+(y/30)}},year:{add:function(w,v){w.setYear(w.getFullYear()+Math[v>0?"floor":"ceil"](v))},diff:function(w,v){return e.month.diff(w,v)/12}}};for(var u in e){if(u.substring(u.length-1)!="s"){e[u+"s"]=e[u]}}var t=function(y,x){if(Date.prototype.strftime.formatShortcuts[x]){return y.strftime(Date.prototype.strftime.formatShortcuts[x])}else{var v=(Date.prototype.strftime.formatCodes[x]||"").split(".");var w=y["get"+v[0]]?y["get"+v[0]]():"";if(v[1]){w=j(w,v[1])}return w}};var q={succ:function(v){return this.clone().add(1,v)},add:function(x,w){var v=e[w]||e.day;if(typeof v=="number"){this.setTime(this.getTime()+(v*x))}else{v.add(this,x)}return this},diff:function(w,z,v){w=Date.create(w);if(w===null){return null}var x=e[z]||e.day;if(typeof x=="number"){var y=(this.getTime()-w.getTime())/x}else{var y=x.diff(this,w)}return(v?y:Math[y>0?"floor":"ceil"](y))},strftime:function(w){var y=w||"%Y-%m-%d",v="",x;while(y.length>0){if(x=y.match(Date.prototype.strftime.formatCodes.matcher)){v+=y.slice(0,x.index);v+=(x[1]||"")+t(this,x[2]);y=y.slice(x.index+x[0].length)}else{v+=y;y=""}}return v},getShortYear:function(){return this.getYear()%100},getMonthNumber:function(){return this.getMonth()+1},getMonthName:function(){return Date.MONTHNAMES[this.getMonth()]},getAbbrMonthName:function(){return Date.ABBR_MONTHNAMES[this.getMonth()]},getDayName:function(){return Date.DAYNAMES[this.getDay()]},getAbbrDayName:function(){return Date.ABBR_DAYNAMES[this.getDay()]},getDayOrdinal:function(){return Date.ORDINALNAMES[this.getDate()%10]},getHours12:function(){var v=this.getHours();return v>12?v-12:(v==0?12:v)},getAmPm:function(){return this.getHours()>=12?"PM":"AM"},getUnix:function(){return Math.round(this.getTime()/1000,0)},getGmtOffset:function(){var v=this.getTimezoneOffset()/60;var w=v<0?"+":"-";v=Math.abs(v);return w+j(Math.floor(v),2)+":"+j((v%1)*60,2)},getTimezoneName:function(){var v=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return v[1]||v[2]||"GMT"+this.getGmtOffset()},toYmdInt:function(){return(this.getFullYear()*10000)+(this.getMonthNumber()*100)+this.getDate()},clone:function(){return new Date(this.getTime())}};for(var a in q){Date.prototype[a]=q[a]}var d={create:function(v){if(v instanceof Date){return v}if(typeof v=="number"){return new Date(v)}var A=String(v).replace(/^\s*(.+)\s*$/,"$1"),w=0,x=Date.create.patterns.length,y;var z=A;while(w31){v=x[3];if(F')}else{if(this.text){var v="position:absolute;top:0px;left:0px;";v+=(this._plotWidth)?"width:"+this._plotWidth+"px;":"";v+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";v+=(this.fontSize)?"font-size:"+this.fontSize+";":"";v+=(this.textAlign)?"text-align:"+this.textAlign+";":"text-align:center;";v+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=h('
'+this.text+"
")}}return this._elem};h.jqplot.DivTitleRenderer.prototype.pack=function(){};h.jqplot.LineRenderer=function(){this.shapeRenderer=new h.jqplot.ShapeRenderer();this.shadowRenderer=new h.jqplot.ShadowRenderer()};h.jqplot.LineRenderer.prototype.init=function(w){h.extend(true,this.renderer,w);var y={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shapeRenderer.init(y);if(this.lineWidth>2.5){var x=this.shadowOffset*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{var x=this.shadowOffset*Math.atan((this.lineWidth/2.5))/0.785398163}var v={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,angle:this.shadowAngle,offset:x,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shadowRenderer.init(v)};h.jqplot.LineRenderer.prototype.setGridData=function(A){var w=this._xaxis.series_u2p;var z=this._yaxis.series_u2p;var x=this._plotData;var y=this._prevPlotData;this.gridData=[];this._prevGridData=[];for(var v=0;v0;K--){N.push(F[K-1])}if(y){this.renderer.shadowRenderer.draw(G,N,E)}this.renderer.shapeRenderer.draw(G,N,E)}}else{if(v){var O=N.slice(0)}if(this.index==0||!this._stack){var A=G.canvas.height;N.unshift([N[0][0],A]);len=N.length;N.push([N[len-1][0],A])}else{var F=this._prevGridData;for(var K=F.length;K>0;K--){N.push(F[K-1])}}if(y){this.renderer.shadowRenderer.draw(G,N,E)}this.renderer.shapeRenderer.draw(G,N,E)}if(v){var I=h.extend(true,{},E,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(G,O,I);if(this.markerRenderer.show){for(K=0;Kv.max||v.max==null){v.max=A[w][0]}}else{if(A[w][1]v.max||v.max==null){v.max=A[w][1]}}}}};h.jqplot.LinearAxisRenderer.prototype.draw=function(v){if(this.show){this.renderer.createTicks.call(this);var B=0;var w;this._elem=h('
');if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var A=this._label.draw(v);A.appendTo(this._elem)}if(this.showTicks){var z=this._ticks;for(var y=0;yD){D=y}}}if(v){x=this._label._elem.outerWidth(true);C=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){D=D+C;this._elem.css({height:D+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){D=D+C;this._elem.css({height:D+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){D=D+x;this._elem.css({width:D+"px",left:"0px",top:"0px"});if(v&&this._label.constructor==h.jqplot.AxisLabelRenderer){this._label._elem.css("width",x+"px")}}else{D=D+x;this._elem.css({width:D+"px",right:"0px",top:"0px"});if(v&&this._label.constructor==h.jqplot.AxisLabelRenderer){this._label._elem.css("width",x+"px")}}}}}};h.jqplot.LinearAxisRenderer.prototype.createTicks=function(){var ab=this._ticks;var X=this.ticks;var ac=this.name;var aa=this._dataBounds;var S,Y;var P,T;var y,x;var v,U;if(X.length){for(U=0;U0){E=Math.max(Math.log(P)/Math.LN10,0.05)}P-=E;T+=E}var K=T-P;var O,R;var W;if(this.autoscale&&this.min==null&&this.max==null){var J,z,L;var F=false;var N=false;var w={min:null,max:null,average:null,stddev:null};for(var U=0;UC){C=H[Q]}}}var M=(C-A)/C;if(I.renderer.constructor==h.jqplot.BarRenderer){if(A>=0&&(I.fillToZero||M>0.1)){F=true}else{F=false;if(I.fill&&I.fillToZero&&A<0&&C>0){N=true}else{N=false}}}else{if(I.fill){if(A>=0&&(I.fillToZero||M>0.1)){F=true}else{if(A<0&&C>0&&I.fillToZero){F=false;N=true}else{F=false;N=false}}}else{if(A<0){F=false}}}}}if(F){this.numberTicks=2+Math.ceil((S-(this.tickSpacing-1))/this.tickSpacing);this.min=0;z=T/(this.numberTicks-1);W=Math.pow(10,Math.abs(Math.floor(Math.log(z)/Math.LN10)));if(z/W==parseInt(z/W,10)){z+=W}this.tickInterval=Math.ceil(z/W)*W;this.max=this.tickInterval*(this.numberTicks-1)}else{if(N){this.numberTicks=2+Math.ceil((S-(this.tickSpacing-1))/this.tickSpacing);var V=Math.ceil(Math.abs(P)/K*(this.numberTicks-1));var Z=this.numberTicks-1-V;z=Math.max(Math.abs(P/V),Math.abs(T/Z));W=Math.pow(10,Math.abs(Math.floor(Math.log(z)/Math.LN10)));this.tickInterval=Math.ceil(z/W)*W;this.max=this.tickInterval*Z;this.min=-this.tickInterval*V}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(K/this.tickInterval)}else{this.numberTicks=2+Math.ceil((S-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){z=K/(this.numberTicks-1);if(z<1){W=Math.pow(10,Math.abs(Math.floor(Math.log(z)/Math.LN10)))}else{W=1}this.tickInterval=Math.ceil(z*W*this.pad)/W}else{W=1/this.tickInterval}J=this.tickInterval*(this.numberTicks-1);L=(J-K)/2;if(this.min==null){this.min=Math.floor(W*(P-L))/W}if(this.max==null){this.max=this.min+J}}}}else{O=(this.min!=null)?this.min:P-K*(this.padMin-1);R=(this.max!=null)?this.max:T+K*(this.padMax-1);this.min=O;this.max=R;K=this.max-this.min;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(S>100){this.numberTicks=parseInt(3+(S-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=K/(this.numberTicks-1)}}for(var U=0;U0){B=-K._textRenderer.height*Math.cos(-K._textRenderer.angle)/2}else{B=-K.getHeight()+K._textRenderer.height*Math.cos(K._textRenderer.angle)/2}break;case"middle":B=-K.getHeight()/2;break;default:B=-K.getHeight()/2;break}}else{B=-K.getHeight()/2}var x=this.u2p(K.value)+B+"px";K._elem.css("top",x);K.pack()}}if(D){var E=this._label._elem.outerHeight(true);this._label._elem.css("top",z-y/2-E/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}};h.jqplot.MarkerRenderer=function(v){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new h.jqplot.ShadowRenderer();this.shapeRenderer=new h.jqplot.ShapeRenderer();h.extend(true,this,v)};h.jqplot.MarkerRenderer.prototype.init=function(v){h.extend(true,this,v);var x={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){x.fill=true}if(this.style.indexOf("ircle")!=-1){x.isarc=true;x.closePath=false}this.shadowRenderer.init(x);var w={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){w.fill=true}if(this.style.indexOf("ircle")!=-1){w.isarc=true;w.closePath=false}this.shapeRenderer.init(w)};h.jqplot.MarkerRenderer.prototype.drawDiamond=function(z,w,C,B,E){var v=1.2;var F=this.size/2/v;var D=this.size/2*v;var A=[[z-F,w],[z,w+D],[z+F,w],[z,w-D]];if(this.shadow){this.shadowRenderer.draw(C,A)}this.shapeRenderer.draw(C,A,E);C.restore()};h.jqplot.MarkerRenderer.prototype.drawPlus=function(A,z,D,C,G){var w=1;var H=this.size/2*w;var E=this.size/2*w;var F=[[A,z-E],[A,z+E]];var B=[[A+H,z],[A-H,z]];var v=h.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(D,F,{closePath:false});this.shadowRenderer.draw(D,B,{closePath:false})}this.shapeRenderer.draw(D,F,v);this.shapeRenderer.draw(D,B,v);D.restore()};h.jqplot.MarkerRenderer.prototype.drawX=function(A,z,D,C,G){var w=1;var H=this.size/2*w;var E=this.size/2*w;var v=h.extend(true,{},this.options,{closePath:false});var F=[[A-H,z-E],[A+H,z+E]];var B=[[A-H,z+E],[A+H,z-E]];if(this.shadow){this.shadowRenderer.draw(D,F,{closePath:false});this.shadowRenderer.draw(D,B,{closePath:false})}this.shapeRenderer.draw(D,F,v);this.shapeRenderer.draw(D,B,v);D.restore()};h.jqplot.MarkerRenderer.prototype.drawDash=function(z,w,C,B,E){var v=1;var F=this.size/2*v;var D=this.size/2*v;var A=[[z-F,w],[z+F,w]];if(this.shadow){this.shadowRenderer.draw(C,A)}this.shapeRenderer.draw(C,A,E);C.restore()};h.jqplot.MarkerRenderer.prototype.drawSquare=function(z,w,C,B,E){var v=1;var F=this.size/2/v;var D=this.size/2*v;var A=[[z-F,w-D],[z-F,w+D],[z+F,w+D],[z+F,w-D]];if(this.shadow){this.shadowRenderer.draw(C,A)}this.shapeRenderer.draw(C,A,E);C.restore()};h.jqplot.MarkerRenderer.prototype.drawCircle=function(w,E,A,D,B){var v=this.size/2;var z=2*Math.PI;var C=[w,E,v,0,z,true];if(this.shadow){this.shadowRenderer.draw(A,C)}this.shapeRenderer.draw(A,C,B);A.restore()};h.jqplot.MarkerRenderer.prototype.draw=function(v,A,w,z){z=z||{};switch(this.style){case"diamond":this.drawDiamond(v,A,w,false,z);break;case"filledDiamond":this.drawDiamond(v,A,w,true,z);break;case"circle":this.drawCircle(v,A,w,false,z);break;case"filledCircle":this.drawCircle(v,A,w,true,z);break;case"square":this.drawSquare(v,A,w,false,z);break;case"filledSquare":this.drawSquare(v,A,w,true,z);break;case"x":this.drawX(v,A,w,true,z);break;case"plus":this.drawPlus(v,A,w,true,z);break;case"dash":this.drawDash(v,A,w,true,z);break;default:this.drawDiamond(v,A,w,false,z);break}};h.jqplot.ShadowRenderer=function(v){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.isarc=false;h.extend(true,this,v)};h.jqplot.ShadowRenderer.prototype.init=function(v){h.extend(true,this,v)};h.jqplot.ShadowRenderer.prototype.draw=function(E,C,F){E.save();var v=(F!=null)?F:{};var D=(v.fill!=null)?v.fill:this.fill;var B=(v.closePath!=null)?v.closePath:this.closePath;var y=(v.offset!=null)?v.offset:this.offset;var w=(v.alpha!=null)?v.alpha:this.alpha;var A=(v.depth!=null)?v.depth:this.depth;E.lineWidth=(v.lineWidth!=null)?v.lineWidth:this.lineWidth;E.lineJoin=(v.lineJoin!=null)?v.lineJoin:this.lineJoin;E.lineCap=(v.lineCap!=null)?v.lineCap:this.lineCap;E.strokeStyle="rgba(0,0,0,"+w+")";E.fillStyle="rgba(0,0,0,"+w+")";for(var x=0;x').appendTo(this._elem);h('
').appendTo(z);var y=h('');y.appendTo(z);if(this.escapeHtml){y.text(x)}else{y.html(x)}};h.jqplot.TableLegendRenderer.prototype.draw=function(){var B=this;if(this.show){var z=this._series;var D="position:absolute;";D+=(this.background)?"background:"+this.background+";":"";D+=(this.border)?"border:"+this.border+";":"";D+=(this.fontSize)?"font-size:"+this.fontSize+";":"";D+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";D+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=h('
');var v=false;for(var A=0;A=C)?"":Array(1+C-G.length>>>0).join(D);return F?G+E:E+G}function x(H,G,J,E,F,D){var I=E-H.length;if(I>0){var C=" ";if(D){C=" "}if(J||!F){H=A(H,E,C,J)}else{H=H.slice(0,G.length)+A("",I,"0",true)+H.slice(G.length)}}return H}function B(K,D,I,E,C,H,J,G){var F=K>>>0;I=I&&F&&{"2":"0b","8":"0","16":"0x"}[D]||"";K=I+A(F.toString(D),H||0,"0",false);return x(K,I,E,C,J,G)}function v(G,H,E,C,F,D){if(C!=null){G=G.slice(0,C)}return x(G,"",H,E,F,D)}var w=arguments,y=0,z=w[y++];return z.replace(h.jqplot.sprintf.regex,function(V,I,J,M,X,T,G){if(V=="%%"){return"%"}var N=false,K="",L=false,U=false,H=false;for(var S=0;J&&S-1?6:(G=="d")?0:void (0)}else{if(T=="*"){T=+w[y++]}else{if(T.charAt(0)=="*"){T=+w[T.slice(1,-1)]}else{T=+T}}}var P=I?w[I.slice(0,-1)]:w[y++];switch(G){case"s":if(P==null){return""}return v(String(P),N,M,T,L,H);case"c":return v(String.fromCharCode(+P),N,M,T,L,H);case"b":return B(P,2,U,N,M,T,L,H);case"o":return B(P,8,U,N,M,T,L,H);case"x":return B(P,16,U,N,M,T,L,H);case"X":return B(P,16,U,N,M,T,L,H).toUpperCase();case"u":return B(P,10,U,N,M,T,L,H);case"i":case"d":var E=parseInt(+P,10);if(isNaN(E)){return""}var R=E<0?"-":K;P=R+A(String(Math.abs(E)),T,"0",false);return x(P,R,N,M,L,H);case"e":case"E":case"f":case"F":case"g":case"G":var E=+P;if(isNaN(E)){return""}var R=E<0?"-":K;var F=["toExponential","toFixed","toPrecision"]["efg".indexOf(G.toLowerCase())];var W=["toString","toUpperCase"]["eEfFgG".indexOf(G)%2];P=R+Math.abs(E)[F](T);return x(P,R,N,M,L,H)[W]();case"p":case"P":var E=+P;if(isNaN(E)){return""}var R=E<0?"-":K;var O=String(Number(Math.abs(E)).toExponential()).split(/e|E/);var D=(O[0].indexOf(".")!=-1)?O[0].length-1:O[0].length;var Q=(O[1]<0)?-O[1]-1:0;if(Math.abs(E)<1){if(D+Q<=T){P=R+Math.abs(E).toPrecision(D)}else{if(D<=T-1){P=R+Math.abs(E).toExponential(D-1)}else{P=R+Math.abs(E).toExponential(T-1)}}}else{var C=(D<=T)?D:T;P=R+Math.abs(E).toPrecision(C)}var W=["toString","toUpperCase"]["pP".indexOf(G)%2];return x(P,R,N,M,L,H)[W]();case"n":return"";default:return V}})};h.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0& ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.barRenderer.js b/frontend/javascripts/jqplot/plugins/jqplot.barRenderer.js deleted file mode 100644 index 4feb37b..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.barRenderer.js +++ /dev/null @@ -1,404 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * The author would appreciate an email letting him know of any substantial - * use of jqPlot. You can reach the author at: chris dot leonello at gmail - * dot com or see http://www.jqplot.com/info.php . This is, of course, - * not required. - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - * - * Thanks for using jqPlot! - * - */ -(function($) { - - // Class: $.jqplot.BarRenderer - // A plugin renderer for jqPlot to draw a bar plot. - // Draws series as a line. - - $.jqplot.BarRenderer = function(){ - $.jqplot.LineRenderer.call(this); - }; - - $.jqplot.BarRenderer.prototype = new $.jqplot.LineRenderer(); - $.jqplot.BarRenderer.prototype.constructor = $.jqplot.BarRenderer; - - // called with scope of series. - $.jqplot.BarRenderer.prototype.init = function(options) { - // Group: Properties - // - // prop: barPadding - // Number of pixels between adjacent bars at the same axis value. - this.barPadding = 8; - // prop: barMargin - // Number of pixels between groups of bars at adjacent axis values. - this.barMargin = 10; - // prop: barDirection - // 'vertical' = up and down bars, 'horizontal' = side to side bars - this.barDirection = 'vertical'; - // prop: barWidth - // Width of the bar in pixels (auto by devaul). null = calculated automatically. - this.barWidth = null; - // prop: shadowOffset - // offset of the shadow from the slice and offset of - // each succesive stroke of the shadow from the last. - this.shadowOffset = 2; - // prop: shadowDepth - // number of strokes to apply to the shadow, - // each stroke offset shadowOffset from the last. - this.shadowDepth = 5; - // prop: shadowAlpha - // transparency of the shadow (0 = transparent, 1 = opaque) - this.shadowAlpha = 0.08; - // prop: waterfall - // true to enable waterfall plot. - this.waterfall = false; - // prop: varyBarColor - // true to color each bar separately. - this.varyBarColor = false; - $.extend(true, this, options); - // fill is still needed to properly draw the legend. - // bars have to be filled. - this.fill = true; - - if (this.waterfall) { - this.fillToZero = false; - this.disableStack = true; - } - - if (this.barDirection == 'vertical' ) { - this._primaryAxis = '_xaxis'; - this._stackAxis = 'y'; - this.fillAxis = 'y'; - } - else { - this._primaryAxis = '_yaxis'; - this._stackAxis = 'x'; - this.fillAxis = 'x'; - } - // set the shape renderer options - var opts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill}; - this.renderer.shapeRenderer.init(opts); - // set the shadow renderer options - var sopts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill}; - this.renderer.shadowRenderer.init(sopts); - }; - - // called with scope of series - function barPreInit(target, data, seriesDefaults, options) { - if (this.rendererOptions.barDirection == 'horizontal') { - this._stackAxis = 'x'; - this._primaryAxis = '_yaxis'; - } - if (this.rendererOptions.waterfall == true) { - this._data = $.extend(true, [], this.data); - var sum = 0; - var pos = (!this.rendererOptions.barDirection || this.rendererOptions.barDirection == 'vertical') ? 1 : 0; - for(var i=0; i0) { - this.data[i][pos] += this.data[i-1][pos]; - } - } - this.data[this.data.length] = (pos == 1) ? [this.data.length+1, sum] : [sum, this.data.length+1]; - this._data[this._data.length] = (pos == 1) ? [this._data.length+1, sum] : [sum, this._data.length+1]; - } - } - - $.jqplot.preSeriesInitHooks.push(barPreInit); - - // needs to be called with scope of series, not renderer. - $.jqplot.BarRenderer.prototype.calcSeriesNumbers = function() { - var nvals = 0; - var nseries = 0; - var paxis = this[this._primaryAxis]; - var s, series, pos; - // loop through all series on this axis - for (var i=0; i < paxis._series.length; i++) { - series = paxis._series[i]; - if (series === this) { - pos = i; - } - // is the series rendered as a bar? - if (series.renderer.constructor == $.jqplot.BarRenderer) { - // gridData may not be computed yet, use data length insted - nvals += series.data.length; - nseries += 1; - } - } - return [nvals, nseries, pos]; - }; - - $.jqplot.BarRenderer.prototype.setBarWidth = function() { - // need to know how many data values we have on the approprate axis and figure it out. - var i; - var nvals = 0; - var nseries = 0; - var paxis = this[this._primaryAxis]; - var s, series, pos; - var temp = this.renderer.calcSeriesNumbers.call(this); - nvals = temp[0]; - nseries = temp[1]; - var nticks = paxis.numberTicks; - var nbins = (nticks-1)/2; - // so, now we have total number of axis values. - if (paxis.name == 'xaxis' || paxis.name == 'x2axis') { - if (this._stack) { - this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals * nseries - this.barMargin; - } - else { - this.barWidth = ((paxis._offsets.max - paxis._offsets.min)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries; - // this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding - this.barMargin/nseries; - } - } - else { - if (this._stack) { - this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals * nseries - this.barMargin; - } - else { - this.barWidth = ((paxis._offsets.min - paxis._offsets.max)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries; - // this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding - this.barMargin/nseries; - } - } - return [nvals, nseries]; - }; - - $.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options) { - var i; - var opts = (options != undefined) ? options : {}; - var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; - var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine; - var fill = (opts.fill != undefined) ? opts.fill : this.fill; - var xaxis = this.xaxis; - var yaxis = this.yaxis; - var xp = this._xaxis.series_u2p; - var yp = this._yaxis.series_u2p; - var pointx, pointy, nvals, nseries, pos; - - if (this.barWidth == null) { - this.renderer.setBarWidth.call(this); - } - - var temp = this.renderer.calcSeriesNumbers.call(this); - nvals = temp[0]; - nseries = temp[1]; - pos = temp[2]; - - if (this._stack) { - this._barNudge = 0; - } - else { - this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding); - } - if (showLine) { - var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors); - var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors); - var negativeColor = negativeColors.get(this.index); - if (! this.useNegativeColors) { - negativeColor = opts.fillStyle; - } - var positiveColor = opts.fillStyle; - - if (this.barDirection == 'vertical') { - for (var i=0; i 0 && i < this.gridData.length-1) { - ystart = this.gridData[i-1][1]; - } - else { - ystart = ctx.canvas.height; - } - } - if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) { - if (this.varyBarColor) { - if (this.useNegativeColors) { - opts.fillStyle = negativeColors.next(); - } - else { - opts.fillStyle = positiveColors.next(); - } - } - else { - opts.fillStyle = negativeColor; - } - } - else { - if (this.varyBarColor) { - opts.fillStyle = positiveColors.next(); - } - else { - opts.fillStyle = positiveColor; - } - } - - points.push([base-this.barWidth/2, ystart]); - points.push([base-this.barWidth/2, gridData[i][1]]); - points.push([base+this.barWidth/2, gridData[i][1]]); - points.push([base+this.barWidth/2, ystart]); - // now draw the shadows if not stacked. - // for stacked plots, they are predrawn by drawShadow - if (shadow && !this._stack) { - this.renderer.shadowRenderer.draw(ctx, points, opts); - } - this.renderer.shapeRenderer.draw(ctx, points, opts); - } - } - - else if (this.barDirection == 'horizontal'){ - for (var i=0; i 0 && i < this.gridData.length-1) { - xstart = this.gridData[i-1][1]; - } - else { - xstart = 0; - } - } - if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) { - if (this.varyBarColor) { - if (this.useNegativeColors) { - opts.fillStyle = negativeColors.next(); - } - else { - opts.fillStyle = positiveColors.next(); - } - } - } - else { - if (this.varyBarColor) { - opts.fillStyle = positiveColors.next(); - } - else { - opts.fillStyle = positiveColor; - } - } - - points.push([xstart, base+this.barWidth/2]); - points.push([gridData[i][0], base+this.barWidth/2]); - points.push([gridData[i][0], base-this.barWidth/2]); - points.push([xstart, base-this.barWidth/2]); - // now draw the shadows if not stacked. - // for stacked plots, they are predrawn by drawShadow - if (shadow && !this._stack) { - this.renderer.shadowRenderer.draw(ctx, points, opts); - } - this.renderer.shapeRenderer.draw(ctx, points, opts); - } - } - } - - }; - - - // for stacked plots, shadows will be pre drawn by drawShadow. - $.jqplot.BarRenderer.prototype.drawShadow = function(ctx, gridData, options) { - var i; - var opts = (options != undefined) ? options : {}; - var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; - var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine; - var fill = (opts.fill != undefined) ? opts.fill : this.fill; - var xaxis = this.xaxis; - var yaxis = this.yaxis; - var xp = this._xaxis.series_u2p; - var yp = this._yaxis.series_u2p; - var pointx, pointy, nvals, nseries, pos; - - if (this._stack && this.shadow) { - if (this.barWidth == null) { - this.renderer.setBarWidth.call(this); - } - - var temp = this.renderer.calcSeriesNumbers.call(this); - nvals = temp[0]; - nseries = temp[1]; - pos = temp[2]; - - if (this._stack) { - this._barNudge = 0; - } - else { - this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding); - } - if (showLine) { - - if (this.barDirection == 'vertical') { - for (var i=0; i0){this.data[d][j]+=this.data[d-1][j]}}this.data[this.data.length]=(j==1)?[this.data.length+1,e]:[e,this.data.length+1];this._data[this._data.length]=(j==1)?[this._data.length+1,e]:[e,this._data.length+1]}}b.jqplot.preSeriesInitHooks.push(a);b.jqplot.BarRenderer.prototype.calcSeriesNumbers=function(){var g=0;var h=0;var f=this[this._primaryAxis];var e,d,j;for(var c=0;c0&&u0&&u 528 || (p[0] == 528 && p[1] >= 16)) { - this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); - } - } - else if ($.browser.mozilla) { - var p = $.browser.version.split("."); - if (p[0] > 1 || (p[0] == 1 && p[1] >= 9 && p[2] > 0) ) { - this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); - } - else { - this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); - } - } - - // TODO: test and enable this - // else if ($.browser.msie) { - // this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); - // } - - else { - this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); - } - } - else { - this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); - } - }; - - $.jqplot.CanvasAxisLabelRenderer.prototype.init = function(options) { - $.extend(true, this, options); - this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily}); - }; - - // return width along the x axis - // will check first to see if an element exists. - // if not, will return the computed text box width. - $.jqplot.CanvasAxisLabelRenderer.prototype.getWidth = function(ctx) { - if (this._elem) { - return this._elem.outerWidth(true); - } - else { - var tr = this._textRenderer; - var l = tr.getWidth(ctx); - var h = tr.getHeight(ctx); - var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l); - return w; - } - }; - - // return height along the y axis. - $.jqplot.CanvasAxisLabelRenderer.prototype.getHeight = function(ctx) { - if (this._elem) { - return this._elem.outerHeight(true); - } - else { - var tr = this._textRenderer; - var l = tr.getWidth(ctx); - var h = tr.getHeight(ctx); - var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l); - return w; - } - }; - - $.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad = function() { - var a = this.angle * Math.PI/180; - return a; - }; - - $.jqplot.CanvasAxisLabelRenderer.prototype.draw = function(ctx) { - // create a canvas here, but can't draw on it untill it is appended - // to dom for IE compatability. - var domelem = document.createElement('canvas'); - this._textRenderer.setText(this.label, ctx); - var w = this.getWidth(ctx); - var h = this.getHeight(ctx); - domelem.width = w; - domelem.height = h; - domelem.style.width = w; - domelem.style.height = h; - // domelem.style.textAlign = 'center'; - domelem.style.position = 'absolute'; - this._domelem = domelem; - this._elem = $(domelem); - this._elem.addClass('jqplot-'+this.axis+'-label'); - - return this._elem; - }; - - $.jqplot.CanvasAxisLabelRenderer.prototype.pack = function() { - if ($.browser.msie) { - window.G_vmlCanvasManager.init_(document); - this._domelem = window.G_vmlCanvasManager.initElement(this._domelem); - } - var ctx = this._elem.get(0).getContext("2d"); - this._textRenderer.draw(ctx, this.label); - }; - -})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js b/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js deleted file mode 100644 index 95ecfdd..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * Although not required, the author would appreciate an email letting him - * know of any substantial use of jqPlot. You can reach the author at: - * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - */ -(function(a){a.jqplot.CanvasAxisLabelRenderer=function(b){this.angle=0;this.axis;this.show=true;this.showLabel=true;this.label="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=false;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);if(b.angle==null&&this.axis!="xaxis"&&this.axis!="x2axis"){this.angle=-90}var e={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){e.pt2px=this.pt2px}if(this.enableFontSupport){if(a.browser.safari){var d=a.browser.version.split(".");for(var c=0;c528||(d[0]==528&&d[1]>=16)){this._textRenderer=new a.jqplot.CanvasFontRenderer(e)}}else{if(a.browser.mozilla){var d=a.browser.version.split(".");if(d[0]>1||(d[0]==1&&d[1]>=9&&d[2]>0)){this._textRenderer=new a.jqplot.CanvasFontRenderer(e)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(e)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(e)}}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(e)}};a.jqplot.CanvasAxisLabelRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(c){var e=document.createElement("canvas");this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.position="absolute";this._domelem=e;this._elem=a(e);this._elem.addClass("jqplot-"+this.axis+"-label");return this._elem};a.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){if(a.browser.msie){window.G_vmlCanvasManager.init_(document);this._domelem=window.G_vmlCanvasManager.initElement(this._domelem)}var b=this._elem.get(0).getContext("2d");this._textRenderer.draw(b,this.label)}})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.js b/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.js deleted file mode 100644 index 77d97f8..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.js +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * The author would appreciate an email letting him know of any substantial - * use of jqPlot. You can reach the author at: chris dot leonello at gmail - * dot com or see http://www.jqplot.com/info.php . This is, of course, - * not required. - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - * - * Thanks for using jqPlot! - * - */ -(function($) { - /** - * Class: $.jqplot.CanvasAxisTickRenderer - * Renderer to draw axis ticks with a canvas element to support advanced - * featrues such as rotated text. This renderer uses a separate rendering engine - * to draw the text on the canvas. Two modes of rendering the text are available. - * If the browser has native font support for canvas fonts (currently Mozila 3.5 - * and Safari 4), you can enable text rendering with the canvas fillText method. - * You do so by setting the "enableFontSupport" option to true. - * - * Browsers lacking native font support will have the text drawn on the canvas - * using the Hershey font metrics. Even if the "enableFontSupport" option is true - * non-supporting browsers will still render with the Hershey font. - */ - $.jqplot.CanvasAxisTickRenderer = function(options) { - // Group: Properties - - // prop: mark - // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null. - this.mark = 'outside'; - // prop: showMark - // wether or not to show the mark on the axis. - this.showMark = true; - // prop: showGridline - // wether or not to draw the gridline on the grid at this tick. - this.showGridline = true; - // prop: isMinorTick - // if this is a minor tick. - this.isMinorTick = false; - // prop: angle - // angle of text, measured clockwise from x axis. - this.angle = 0; - // prop: markSize - // Length of the tick marks in pixels. For 'cross' style, length - // will be stoked above and below axis, so total length will be twice this. - this.markSize = 4; - // prop: show - // wether or not to show the tick (mark and label). - this.show = true; - // prop: showLabel - // wether or not to show the label. - this.showLabel = true; - // prop: labelPosition - // 'auto', 'start', 'middle' or 'end'. - // Whether tick label should be positioned so the start, middle, or end - // of the tick mark. - this.labelPosition = 'auto'; - this.label = ''; - this.value = null; - this._styles = {}; - // prop: formatter - // A class of a formatter for the tick text. - // The default $.jqplot.DefaultTickFormatter uses sprintf. - this.formatter = $.jqplot.DefaultTickFormatter; - // prop: formatString - // string passed to the formatter. - this.formatString = ''; - // prop: fontFamily - // css spec for the font-family css attribute. - this.fontFamily = '"Trebuchet MS", Arial, Helvetica, sans-serif'; - // prop: fontSize - // CSS spec for font size. - this.fontSize = '11px'; - // prop: fontWeight - // CSS spec for fontWeight - this.fontWeight = 'normal'; - // prop: fontStretch - // Multiplier to condense or expand font width. - // Applies only to browsers which don't support canvas native font rendering. - this.fontStretch = 1.0; - // prop: textColor - // css spec for the color attribute. - this.textColor = '#666666'; - // prop: enableFontSupport - // true to turn on native canvas font support in Mozilla 3.5+ and Safari 4+. - // If true, tick label will be drawn with canvas tag native support for fonts. - // If false, tick label will be drawn with Hershey font metrics. - this.enableFontSupport = false; - // prop: pt2px - // Point to pixel scaling factor, used for computing height of bounding box - // around a label. The labels text renderer has a default setting of 1.4, which - // should be suitable for most fonts. Leave as null to use default. If tops of - // letters appear clipped, increase this. If bounding box seems too big, decrease. - // This is an issue only with the native font renderering capabilities of Mozilla - // 3.5 and Safari 4 since they do not provide a method to determine the font height. - this.pt2px = null; - - this._elem; - this._ctx; - this._plotWidth; - this._plotHeight; - this._plotDimensions = {height:null, width:null}; - - $.extend(true, this, options); - - var ropts = {fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily}; - if (this.pt2px) { - ropts.pt2px = this.pt2px; - } - - if (this.enableFontSupport) { - if ($.browser.safari) { - var p = $.browser.version.split('.'); - for (var i=0; i 528 || (p[0] == 528 && p[1] >= 16)) { - this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); - } - } - else if ($.browser.mozilla) { - var p = $.browser.version.split("."); - if (p[0] > 1 || (p[0] == 1 && p[1] >= 9 && p[2] > 0) ) { - this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); - } - else { - this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); - } - } - - // TODO: test and enable this - // else if ($.browser.msie) { - // this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); - // } - - else { - this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); - } - } - else { - this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); - } - }; - - $.jqplot.CanvasAxisTickRenderer.prototype.init = function(options) { - $.extend(true, this, options); - this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily}); - }; - - // return width along the x axis - // will check first to see if an element exists. - // if not, will return the computed text box width. - $.jqplot.CanvasAxisTickRenderer.prototype.getWidth = function(ctx) { - if (this._elem) { - return this._elem.outerWidth(true); - } - else { - var tr = this._textRenderer; - var l = tr.getWidth(ctx); - var h = tr.getHeight(ctx); - var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l); - return w; - } - }; - - // return height along the y axis. - $.jqplot.CanvasAxisTickRenderer.prototype.getHeight = function(ctx) { - if (this._elem) { - return this._elem.outerHeight(true); - } - else { - var tr = this._textRenderer; - var l = tr.getWidth(ctx); - var h = tr.getHeight(ctx); - var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l); - return w; - } - }; - - $.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad = function() { - var a = this.angle * Math.PI/180; - return a; - }; - - - $.jqplot.CanvasAxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) { - this.value = value; - if (isMinor) { - this.isMinorTick = true; - } - return this; - }; - - $.jqplot.CanvasAxisTickRenderer.prototype.draw = function(ctx) { - if (!this.label) { - this.label = this.formatter(this.formatString, this.value); - } - // create a canvas here, but can't draw on it untill it is appended - // to dom for IE compatability. - var domelem = document.createElement('canvas'); - this._textRenderer.setText(this.label, ctx); - var w = this.getWidth(ctx); - var h = this.getHeight(ctx); - domelem.width = w; - domelem.height = h; - domelem.style.width = w; - domelem.style.height = h; - domelem.style.textAlign = 'left'; - domelem.style.position = 'absolute'; - this._domelem = domelem; - this._elem = $(domelem); - this._elem.css(this._styles); - this._elem.addClass('jqplot-'+this.axis+'-tick'); - - return this._elem; - }; - - $.jqplot.CanvasAxisTickRenderer.prototype.pack = function() { - if ($.browser.msie) { - window.G_vmlCanvasManager.init_(document); - this._domelem = window.G_vmlCanvasManager.initElement(this._domelem); - } - var ctx = this._elem.get(0).getContext("2d"); - this._textRenderer.draw(ctx, this.label); - }; - -})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js b/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js deleted file mode 100644 index 941fed2..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * Although not required, the author would appreciate an email letting him - * know of any substantial use of jqPlot. You can reach the author at: - * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - */ -(function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside";this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.angle=0;this.markSize=4;this.show=true;this.showLabel=true;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=a.jqplot.DefaultTickFormatter;this.formatString="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11px";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=false;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);var e={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){e.pt2px=this.pt2px}if(this.enableFontSupport){if(a.browser.safari){var d=a.browser.version.split(".");for(var c=0;c528||(d[0]==528&&d[1]>=16)){this._textRenderer=new a.jqplot.CanvasFontRenderer(e)}}else{if(a.browser.mozilla){var d=a.browser.version.split(".");if(d[0]>1||(d[0]==1&&d[1]>=9&&d[2]>0)){this._textRenderer=new a.jqplot.CanvasFontRenderer(e)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(e)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(e)}}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(e)}};a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(b,d,c){this.value=b;if(c){this.isMinorTick=true}return this};a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(c){if(!this.label){this.label=this.formatter(this.formatString,this.value)}var e=document.createElement("canvas");this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.textAlign="left";e.style.position="absolute";this._domelem=e;this._elem=a(e);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");return this._elem};a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){if(a.browser.msie){window.G_vmlCanvasManager.init_(document);this._domelem=window.G_vmlCanvasManager.initElement(this._domelem)}var b=this._elem.get(0).getContext("2d");this._textRenderer.draw(b,this.label)}})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.canvasTextRenderer.js b/frontend/javascripts/jqplot/plugins/jqplot.canvasTextRenderer.js deleted file mode 100644 index 8536efb..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.canvasTextRenderer.js +++ /dev/null @@ -1,408 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * The author would appreciate an email letting him know of any substantial - * use of jqPlot. You can reach the author at: chris dot leonello at gmail - * dot com or see http://www.jqplot.com/info.php . This is, of course, - * not required. - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - * - * Thanks for using jqPlot! - * - */ -(function($) { - // This code is a modified version of the canvastext.js code, copyright below: - // - // This code is released to the public domain by Jim Studt, 2007. - // He may keep some sort of up to date copy at http://www.federated.com/~jim/canvastext/ - // - $.jqplot.CanvasTextRenderer = function(options){ - this.fontStyle = 'normal'; // normal, italic, oblique [not implemented] - this.fontVariant = 'normal'; // normal, small caps [not implemented] - this.fontWeight = 'normal'; // normal, bold, bolder, lighter, 100 - 900 - this.fontSize = '10px'; - this.fontFamily = 'sans-serif'; - this.fontStretch = 1.0; - this.fillStyle = '#666666'; - this.angle = 0; - this.textAlign = 'start'; - this.textBaseline = 'alphabetic'; - this.text; - this.width; - this.height; - this.pt2px = 1.28; - - $.extend(true, this, options); - this.normalizedFontSize = this.normalizeFontSize(this.fontSize); - this.setHeight(); - }; - - $.jqplot.CanvasTextRenderer.prototype.init = function(options) { - $.extend(true, this, options); - this.normalizedFontSize = this.normalizeFontSize(this.fontSize); - this.setHeight(); - }; - - // convert css spec into point size - // returns float - $.jqplot.CanvasTextRenderer.prototype.normalizeFontSize = function(sz) { - sz = String(sz); - n = parseFloat(sz); - if (sz.indexOf('px') > -1) { - return n/this.pt2px; - } - else if (sz.indexOf('pt') > -1) { - return n; - } - else if (sz.indexOf('em') > -1) { - return n*12; - } - else if (sz.indexOf('%') > -1) { - return n*12/100; - } - // default to pixels; - else { - return n/this.pt2px; - } - }; - - - $.jqplot.CanvasTextRenderer.prototype.fontWeight2Float = function(w) { - // w = normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 - // return values adjusted for Hershey font. - if (Number(w)) { - return w/400; - } - else { - switch (w) { - case 'normal': - return 1; - break; - case 'bold': - return 1.75; - break; - case 'bolder': - return 2.25; - break; - case 'lighter': - return 0.75; - break; - default: - return 1; - break; - } - } - }; - - $.jqplot.CanvasTextRenderer.prototype.getText = function() { - return this.text; - }; - - $.jqplot.CanvasTextRenderer.prototype.setText = function(t, ctx) { - this.text = t; - this.setWidth(ctx); - return this; - }; - - $.jqplot.CanvasTextRenderer.prototype.getWidth = function(ctx) { - return this.width; - }; - - $.jqplot.CanvasTextRenderer.prototype.setWidth = function(ctx, w) { - if (!w) { - this.width = this.measure(ctx, this.text); - } - else { - this.width = w; - } - return this; - }; - - // return height in pixels. - $.jqplot.CanvasTextRenderer.prototype.getHeight = function(ctx) { - return this.height; - }; - - // w - height in pt - // set heigh in px - $.jqplot.CanvasTextRenderer.prototype.setHeight = function(w) { - if (!w) { - //height = this.fontSize /0.75; - this.height = this.normalizedFontSize * this.pt2px; - } - else { - this.height = w; - } - return this; - }; - - $.jqplot.CanvasTextRenderer.prototype.letter = function (ch) - { - return this.letters[ch]; - }; - - $.jqplot.CanvasTextRenderer.prototype.ascent = function() - { - return this.normalizedFontSize; - }; - - $.jqplot.CanvasTextRenderer.prototype.descent = function() - { - return 7.0*this.normalizedFontSize/25.0; - }; - - $.jqplot.CanvasTextRenderer.prototype.measure = function(ctx, str) - { - var total = 0; - var len = str.length; - - for ( i = 0; i < len; i++) { - var c = this.letter(str.charAt(i)); - if (c) { - total += c.width * this.normalizedFontSize / 25.0 * this.fontStretch; - } - } - return total; - }; - - $.jqplot.CanvasTextRenderer.prototype.draw = function(ctx,str) - { - var x = 0; - // leave room at bottom for descenders. - var y = this.height*0.72; - var total = 0; - var len = str.length; - var mag = this.normalizedFontSize / 25.0; - - ctx.save(); - var tx, ty; - - // 1st quadrant - if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) { - tx = 0; - ty = -Math.sin(this.angle) * this.width; - } - // 4th quadrant - else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) { - tx = Math.sin(this.angle) * this.height; - ty = 0; - } - // 2nd quadrant - else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) { - tx = -Math.cos(this.angle) * this.width; - ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height; - } - // 3rd quadrant - else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) { - tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width; - ty = -Math.cos(this.angle) * this.height; - } - - ctx.strokeStyle = this.fillStyle; - ctx.fillStyle = this.fillStyle; - ctx.translate(tx, ty); - ctx.rotate(this.angle); - ctx.lineCap = "round"; - // multiplier was 2.0 - var fact = (this.normalizedFontSize > 30) ? 2.0 : 2 + (30 - this.normalizedFontSize)/20; - ctx.lineWidth = fact * mag * this.fontWeight2Float(this.fontWeight); - - for ( var i = 0; i < len; i++) { - var c = this.letter( str.charAt(i)); - if ( !c) { - continue; - } - - ctx.beginPath(); - - var penUp = 1; - var needStroke = 0; - for ( var j = 0; j < c.points.length; j++) { - var a = c.points[j]; - if ( a[0] == -1 && a[1] == -1) { - penUp = 1; - continue; - } - if ( penUp) { - ctx.moveTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag); - penUp = false; - } else { - ctx.lineTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag); - } - } - ctx.stroke(); - x += c.width*mag*this.fontStretch; - } - ctx.restore(); - return total; - }; - - $.jqplot.CanvasTextRenderer.prototype.letters = { - ' ': { width: 16, points: [] }, - '!': { width: 10, points: [[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] }, - '"': { width: 16, points: [[4,21],[4,14],[-1,-1],[12,21],[12,14]] }, - '#': { width: 21, points: [[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]] }, - '$': { width: 20, points: [[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] }, - '%': { width: 24, points: [[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]] }, - '&': { width: 26, points: [[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]] }, - '\'': { width: 10, points: [[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]] }, - '(': { width: 14, points: [[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]] }, - ')': { width: 14, points: [[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]] }, - '*': { width: 16, points: [[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]] }, - '+': { width: 26, points: [[13,18],[13,0],[-1,-1],[4,9],[22,9]] }, - ',': { width: 10, points: [[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] }, - '-': { width: 18, points: [[6,9],[12,9]] }, - '.': { width: 10, points: [[5,2],[4,1],[5,0],[6,1],[5,2]] }, - '/': { width: 22, points: [[20,25],[2,-7]] }, - '0': { width: 20, points: [[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]] }, - '1': { width: 20, points: [[6,17],[8,18],[11,21],[11,0]] }, - '2': { width: 20, points: [[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]] }, - '3': { width: 20, points: [[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] }, - '4': { width: 20, points: [[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]] }, - '5': { width: 20, points: [[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] }, - '6': { width: 20, points: [[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]] }, - '7': { width: 20, points: [[17,21],[7,0],[-1,-1],[3,21],[17,21]] }, - '8': { width: 20, points: [[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]] }, - '9': { width: 20, points: [[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]] }, - ':': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] }, - ';': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] }, - '<': { width: 24, points: [[20,18],[4,9],[20,0]] }, - '=': { width: 26, points: [[4,12],[22,12],[-1,-1],[4,6],[22,6]] }, - '>': { width: 24, points: [[4,18],[20,9],[4,0]] }, - '?': { width: 18, points: [[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]] }, - '@': { width: 27, points: [[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]] }, - 'A': { width: 18, points: [[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]] }, - 'B': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]] }, - 'C': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]] }, - 'D': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]] }, - 'E': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]] }, - 'F': { width: 18, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]] }, - 'G': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]] }, - 'H': { width: 22, points: [[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]] }, - 'I': { width: 8, points: [[4,21],[4,0]] }, - 'J': { width: 16, points: [[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]] }, - 'K': { width: 21, points: [[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]] }, - 'L': { width: 17, points: [[4,21],[4,0],[-1,-1],[4,0],[16,0]] }, - 'M': { width: 24, points: [[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]] }, - 'N': { width: 22, points: [[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]] }, - 'O': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]] }, - 'P': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]] }, - 'Q': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]] }, - 'R': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]] }, - 'S': { width: 20, points: [[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] }, - 'T': { width: 16, points: [[8,21],[8,0],[-1,-1],[1,21],[15,21]] }, - 'U': { width: 22, points: [[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]] }, - 'V': { width: 18, points: [[1,21],[9,0],[-1,-1],[17,21],[9,0]] }, - 'W': { width: 24, points: [[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]] }, - 'X': { width: 20, points: [[3,21],[17,0],[-1,-1],[17,21],[3,0]] }, - 'Y': { width: 18, points: [[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]] }, - 'Z': { width: 20, points: [[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]] }, - '[': { width: 14, points: [[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]] }, - '\\': { width: 14, points: [[0,21],[14,-3]] }, - ']': { width: 14, points: [[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]] }, - '^': { width: 16, points: [[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]] }, - '_': { width: 16, points: [[0,-2],[16,-2]] }, - '`': { width: 10, points: [[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]] }, - 'a': { width: 19, points: [[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, - 'b': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] }, - 'c': { width: 18, points: [[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, - 'd': { width: 19, points: [[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, - 'e': { width: 18, points: [[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, - 'f': { width: 12, points: [[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]] }, - 'g': { width: 19, points: [[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, - 'h': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] }, - 'i': { width: 8, points: [[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]] }, - 'j': { width: 10, points: [[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]] }, - 'k': { width: 17, points: [[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]] }, - 'l': { width: 8, points: [[4,21],[4,0]] }, - 'm': { width: 30, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]] }, - 'n': { width: 19, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] }, - 'o': { width: 19, points: [[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]] }, - 'p': { width: 19, points: [[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] }, - 'q': { width: 19, points: [[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, - 'r': { width: 13, points: [[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]] }, - 's': { width: 17, points: [[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]] }, - 't': { width: 12, points: [[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]] }, - 'u': { width: 19, points: [[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]] }, - 'v': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0]] }, - 'w': { width: 22, points: [[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]] }, - 'x': { width: 17, points: [[3,14],[14,0],[-1,-1],[14,14],[3,0]] }, - 'y': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]] }, - 'z': { width: 17, points: [[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]] }, - '{': { width: 14, points: [[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]] }, - '|': { width: 8, points: [[4,25],[4,-7]] }, - '}': { width: 14, points: [[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]] }, - '~': { width: 24, points: [[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]] } - }; - - $.jqplot.CanvasFontRenderer = function(options) { - options = options || {}; - if (!options.pt2px) { - options.pt2px = 1.5; - } - $.jqplot.CanvasTextRenderer.call(this, options); - }; - - $.jqplot.CanvasFontRenderer.prototype = new $.jqplot.CanvasTextRenderer({}); - $.jqplot.CanvasFontRenderer.prototype.constructor = $.jqplot.CanvasFontRenderer; - - $.jqplot.CanvasFontRenderer.prototype.measure = function(ctx, str) - { - // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily; - var fstyle = this.fontSize+' '+this.fontFamily; - ctx.save(); - ctx.font = fstyle; - var w = ctx.measureText(str).width; - ctx.restore(); - return w; - }; - - $.jqplot.CanvasFontRenderer.prototype.draw = function(ctx, str) - { - var x = 0; - // leave room at bottom for descenders. - var y = this.height*0.72; - //var y = 12; - - ctx.save(); - var tx, ty; - - // 1st quadrant - if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) { - tx = 0; - ty = -Math.sin(this.angle) * this.width; - } - // 4th quadrant - else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) { - tx = Math.sin(this.angle) * this.height; - ty = 0; - } - // 2nd quadrant - else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) { - tx = -Math.cos(this.angle) * this.width; - ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height; - } - // 3rd quadrant - else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) { - tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width; - ty = -Math.cos(this.angle) * this.height; - } - ctx.strokeStyle = this.fillStyle; - ctx.fillStyle = this.fillStyle; - // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily; - var fstyle = this.fontSize+' '+this.fontFamily; - ctx.font = fstyle; - ctx.translate(tx, ty); - ctx.rotate(this.angle); - ctx.fillText(str, x, y); - // ctx.strokeText(str, x, y); - - ctx.restore(); - }; - -})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.canvasTextRenderer.min.js b/frontend/javascripts/jqplot/plugins/jqplot.canvasTextRenderer.min.js deleted file mode 100644 index 0dbb8a6..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.canvasTextRenderer.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * Although not required, the author would appreciate an email letting him - * know of any substantial use of jqPlot. You can reach the author at: - * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - */ -(function(a){a.jqplot.CanvasTextRenderer=function(b){this.fontStyle="normal";this.fontVariant="normal";this.fontWeight="normal";this.fontSize="10px";this.fontFamily="sans-serif";this.fontStretch=1;this.fillStyle="#666666";this.angle=0;this.textAlign="start";this.textBaseline="alphabetic";this.text;this.width;this.height;this.pt2px=1.28;a.extend(true,this,b);this.normalizedFontSize=this.normalizeFontSize(this.fontSize);this.setHeight()};a.jqplot.CanvasTextRenderer.prototype.init=function(b){a.extend(true,this,b);this.normalizedFontSize=this.normalizeFontSize(this.fontSize);this.setHeight()};a.jqplot.CanvasTextRenderer.prototype.normalizeFontSize=function(b){b=String(b);n=parseFloat(b);if(b.indexOf("px")>-1){return n/this.pt2px}else{if(b.indexOf("pt")>-1){return n}else{if(b.indexOf("em")>-1){return n*12}else{if(b.indexOf("%")>-1){return n*12/100}else{return n/this.pt2px}}}}};a.jqplot.CanvasTextRenderer.prototype.fontWeight2Float=function(b){if(Number(b)){return b/400}else{switch(b){case"normal":return 1;break;case"bold":return 1.75;break;case"bolder":return 2.25;break;case"lighter":return 0.75;break;default:return 1;break}}};a.jqplot.CanvasTextRenderer.prototype.getText=function(){return this.text};a.jqplot.CanvasTextRenderer.prototype.setText=function(c,b){this.text=c;this.setWidth(b);return this};a.jqplot.CanvasTextRenderer.prototype.getWidth=function(b){return this.width};a.jqplot.CanvasTextRenderer.prototype.setWidth=function(c,b){if(!b){this.width=this.measure(c,this.text)}else{this.width=b}return this};a.jqplot.CanvasTextRenderer.prototype.getHeight=function(b){return this.height};a.jqplot.CanvasTextRenderer.prototype.setHeight=function(b){if(!b){this.height=this.normalizedFontSize*this.pt2px}else{this.height=b}return this};a.jqplot.CanvasTextRenderer.prototype.letter=function(b){return this.letters[b]};a.jqplot.CanvasTextRenderer.prototype.ascent=function(){return this.normalizedFontSize};a.jqplot.CanvasTextRenderer.prototype.descent=function(){return 7*this.normalizedFontSize/25};a.jqplot.CanvasTextRenderer.prototype.measure=function(d,f){var e=0;var b=f.length;for(i=0;i30)?2:2+(30-this.normalizedFontSize)/20;t.lineWidth=u*k*this.fontWeight2Float(this.fontWeight);for(var g=0;g":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};a.jqplot.CanvasFontRenderer=function(b){b=b||{};if(!b.pt2px){b.pt2px=1.5}a.jqplot.CanvasTextRenderer.call(this,b)};a.jqplot.CanvasFontRenderer.prototype=new a.jqplot.CanvasTextRenderer({});a.jqplot.CanvasFontRenderer.prototype.constructor=a.jqplot.CanvasFontRenderer;a.jqplot.CanvasFontRenderer.prototype.measure=function(c,e){var d=this.fontSize+" "+this.fontFamily;c.save();c.font=d;var b=c.measureText(e).width;c.restore();return b};a.jqplot.CanvasFontRenderer.prototype.draw=function(e,g){var c=0;var h=this.height*0.72;e.save();var d,b;if((-Math.PI/2<=this.angle&&this.angle<=0)||(Math.PI*3/2<=this.angle&&this.angle<=Math.PI*2)){d=0;b=-Math.sin(this.angle)*this.width}else{if((0 class. - * - * To use this renderer, include the plugin in your source - * > - * - * and supply the appropriate options to your plot - * - * > {axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}} - **/ - $.jqplot.CategoryAxisRenderer = function() { - $.jqplot.LinearAxisRenderer.call(this); - }; - - $.jqplot.CategoryAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); - $.jqplot.CategoryAxisRenderer.prototype.constructor = $.jqplot.CategoryAxisRenderer; - - $.jqplot.CategoryAxisRenderer.prototype.init = function(options){ - // prop: tickRenderer - // A class of a rendering engine for creating the ticks labels displayed on the plot, - // See <$.jqplot.AxisTickRenderer>. - // this.tickRenderer = $.jqplot.AxisTickRenderer; - // this.labelRenderer = $.jqplot.AxisLabelRenderer; - $.extend(true, this, {tickOptions:{formatString:'%d'}}, options); - var db = this._dataBounds; - // Go through all the series attached to this axis and find - // the min/max bounds for this axis. - for (var i=0; i db.max || db.max == null) { - db.max = d[j][0]; - } - } - else { - if (d[j][1] < db.min || db.min == null) { - db.min = d[j][1]; - } - if (d[j][1] > db.max || db.max == null) { - db.max = d[j][1]; - } - } - } - } - }; - - - $.jqplot.CategoryAxisRenderer.prototype.createTicks = function() { - // we're are operating on an axis here - var ticks = this._ticks; - var userTicks = this.ticks; - var name = this.name; - // databounds were set on axis initialization. - var db = this._dataBounds; - var dim, interval; - var min, max; - var pos1, pos2; - var tt, i; - - // if we already have ticks, use them. - if (userTicks.length) { - this.min = 0.5; - this.max = userTicks.length + 0.5; - var range = this.max - this.min; - this.numberTicks = 2*userTicks.length + 1; - for (i=0; i0 && trackb.max||b.max==null){b.max=h[c][0]}}else{if(h[c][1]b.max||b.max==null){b.max=h[c][1]}}}}};a.jqplot.CategoryAxisRenderer.prototype.createTicks=function(){var y=this._ticks;var v=this.ticks;var B=this.name;var x=this._dataBounds;var p,w;var n,q;var d,c;var b,r;if(v.length){this.min=0.5;this.max=v.length+0.5;var h=this.max-this.min;this.numberTicks=2*v.length+1;for(r=0;r0&&l= 1 or will often miss point intersections. - this.intersectionThreshold = 2; - // prop: showCursorLegend - // Replace the plot legend with an enhanced legend displaying intersection information. - this.showCursorLegend = false; - // prop: cursorLegendFormatString - // Format string used in the cursor legend. If showTooltipDataPosition is true, - // this will also be the default format string used by tooltipFormatString. - this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString; - $.extend(true, this, options); - }; - - $.jqplot.Cursor.cursorLegendFormatString = '%s x:%s, y:%s'; - - // called with scope of plot - $.jqplot.Cursor.init = function (target, data, opts){ - // add a cursor attribute to the plot - var options = opts || {}; - this.plugins.cursor = new $.jqplot.Cursor(options.cursor); - var c = this.plugins.cursor; - - if (c.show) { - $.jqplot.eventListenerHooks.push(['jqplotMouseEnter', handleMouseEnter]); - $.jqplot.eventListenerHooks.push(['jqplotMouseLeave', handleMouseLeave]); - $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMouseMove]); - - if (c.showCursorLegend) { - opts.legend = opts.legend || {}; - opts.legend.renderer = $.jqplot.CursorLegendRenderer; - opts.legend.formatString = this.plugins.cursor.cursorLegendFormatString; - opts.legend.show = true; - } - - if (c.zoom) { - $.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleMouseDown]); - $.jqplot.eventListenerHooks.push(['jqplotMouseUp', handleMouseUp]); - - if (c.clickReset) { - $.jqplot.eventListenerHooks.push(['jqplotClick', handleClick]); - } - - if (c.dblClickReset) { - $.jqplot.eventListenerHooks.push(['jqplotDblClick', handleDblClick]); - } - } - - this.resetZoom = function() { - var axes = this.axes; - if (!c.zoomProxy) { - for (var ax in axes) { - axes[ax].reset(); - } - this.redraw(); - } - else { - var ctx = this.plugins.cursor.zoomCanvas._ctx; - ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); - } - this.plugins.cursor._zoom.isZoomed = false; - this.target.trigger('jqplotResetZoom', [this, this.plugins.cursor]); - }; - - - if (c.showTooltipDataPosition) { - c.showTooltipUnitPosition = false; - c.showTooltipGridPosition = false; - if (options.cursor.tooltipFormatString == undefined) { - c.tooltipFormatString = $.jqplot.Cursor.cursorLegendFormatString; - } - } - } - }; - - // called with context of plot - $.jqplot.Cursor.postDraw = function() { - var c = this.plugins.cursor; - // if (c.zoom) { - c.zoomCanvas = new $.jqplot.GenericCanvas(); - this.eventCanvas._elem.before(c.zoomCanvas.createElement(this._gridPadding, 'jqplot-zoom-canvas', this._plotDimensions)); - var zctx = c.zoomCanvas.setContext(); - // } - c._tooltipElem = $(''); - c.zoomCanvas._elem.before(c._tooltipElem); - if (c.showVerticalLine || c.showHorizontalLine) { - c.cursorCanvas = new $.jqplot.GenericCanvas(); - this.eventCanvas._elem.before(c.cursorCanvas.createElement(this._gridPadding, 'jqplot-cursor-canvas', this._plotDimensions)); - var zctx = c.cursorCanvas.setContext(); - } - - // if we are showing the positions in unit coordinates, and no axes groups - // were specified, create a default set. - if (c.showTooltipUnitPosition){ - if (c.tooltipAxisGroups.length === 0) { - var series = this.series; - var s; - var temp = []; - for (var i=0; i 6 && Math.abs(gridpos.y - c._zoom.start[1]) > 6) || (c.constrainZoomTo == 'x' && Math.abs(gridpos.x - c._zoom.start[0]) > 6) || (c.constrainZoomTo == 'y' && Math.abs(gridpos.y - c._zoom.start[1]) > 6)) { - if (!plot.plugins.cursor.zoomProxy) { - for (var ax in datapos) { - // make a copy of the original axes to revert back. - if (c._zoom.axes[ax] == undefined) { - c._zoom.axes[ax] = {}; - c._zoom.axes[ax].numberTicks = axes[ax].numberTicks; - c._zoom.axes[ax].tickInterval = axes[ax].tickInterval; - // for date axes... - c._zoom.axes[ax].daTickInterval = axes[ax].daTickInterval; - c._zoom.axes[ax].min = axes[ax].min; - c._zoom.axes[ax].max = axes[ax].max; - } - if ((c.constrainZoomTo == 'none') || (c.constrainZoomTo == 'x' && ax.charAt(0) == 'x') || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'y')) { - dp = datapos[ax]; - if (dp != null) { - if (dp > start[ax]) { - axes[ax].min = start[ax]; - axes[ax].max = dp; - } - else { - span = start[ax] - dp; - axes[ax].max = start[ax]; - axes[ax].min = dp; - } - axes[ax].tickInterval = null; - // for date axes... - axes[ax].daTickInterval = null; - axes[ax]._ticks = []; - } - } - - // if ((c.constrainZoomTo == 'x' && ax.charAt(0) == 'y' && c.autoscaleConstraint) || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'x' && c.autoscaleConstraint)) { - // dp = datapos[ax]; - // if (dp != null) { - // axes[ax].max == null; - // axes[ax].min = null; - // } - // } - } - ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); - plot.redraw(); - c._zoom.isZoomed = true; - } - plot.target.trigger('jqplotZoom', [gridpos, datapos, plot, cursor]); - } - }; - - $.jqplot.preInitHooks.push($.jqplot.Cursor.init); - $.jqplot.postDrawHooks.push($.jqplot.Cursor.postDraw); - - function updateTooltip(gridpos, datapos, plot) { - var c = plot.plugins.cursor; - var s = ''; - var addbr = false; - if (c.showTooltipGridPosition) { - s = gridpos.x+', '+gridpos.y; - addbr = true; - } - if (c.showTooltipUnitPosition) { - var g; - for (var i=0; i start[0]) { - l = start[0]; - w = end[0] - start[0]; - } - else { - l = end[0]; - w = start[0] - end[0]; - } - if (end[1] > start[1]) { - t = start[1]; - h = end[1] - start[1]; - } - else { - t = end[1]; - h = start[1] - end[1]; - } - ctx.fillStyle = 'rgba(0,0,0,0.2)'; - ctx.strokeStyle = '#999999'; - ctx.lineWidth = 1.0; - ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); - ctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height); - ctx.clearRect(l, t, w, h); - // IE won't show transparent fill rect, so stroke a rect also. - ctx.strokeRect(l,t,w,h); - } - - $.jqplot.CursorLegendRenderer = function(options) { - $.jqplot.TableLegendRenderer.call(this, options); - this.formatString = '%s'; - }; - - $.jqplot.CursorLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); - $.jqplot.CursorLegendRenderer.prototype.constructor = $.jqplot.CursorLegendRenderer; - - // called in context of a Legend - $.jqplot.CursorLegendRenderer.prototype.draw = function() { - if (this.show) { - var series = this._series; - // make a table. one line label per row. - this._elem = $('
'); - - var pad = false; - for (var i = 0; i< series.length; i++) { - s = series[i]; - if (s.show) { - var lt = $.jqplot.sprintf(this.formatString, s.label.toString()); - if (lt) { - var color = s.color; - if (s._stack && !s.fill) { - color = ''; - } - addrow.call(this, lt, color, pad, i); - pad = true; - } - // let plugins add more rows to legend. Used by trend line plugin. - for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) { - var item = $.jqplot.addLegendRowHooks[j].call(this, s); - if (item) { - addrow.call(this, item.label, item.color, pad); - pad = true; - } - } - } - } - } - - function addrow(label, color, pad, idx) { - var rs = (pad) ? this.rowSpacing : '0'; - var tr = $('').appendTo(this._elem); - tr.data('seriesIndex', idx); - $(''+ - '
'+ - '
'+ - '
').appendTo(tr); - var td = $(''); - td.appendTo(tr); - td.data('seriesIndex', idx); - if (this.escapeHtml) { - td.text(label); - } - else { - td.html(label); - } - } - return this._elem; - }; - -})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.cursor.min.js b/frontend/javascripts/jqplot/plugins/jqplot.cursor.min.js deleted file mode 100644 index 3ce2ea5..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.cursor.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * Although not required, the author would appreciate an email letting him - * know of any substantial use of jqPlot. You can reach the author at: - * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - */ -(function(i){i.jqplot.Cursor=function(o){this.style="crosshair";this.previousCursor="auto";this.show=i.jqplot.config.enablePlugins;this.showTooltip=true;this.followMouse=false;this.tooltipLocation="se";this.tooltipOffset=6;this.showTooltipGridPosition=false;this.showTooltipUnitPosition=true;this.showTooltipDataPosition=false;this.tooltipFormatString="%.4P, %.4P";this.useAxesFormatters=true;this.tooltipAxisGroups=[];this.zoom=false;this.zoomProxy=false;this.zoomTarget=false;this.clickReset=false;this.dblClickReset=true;this.showVerticalLine=false;this.showHorizontalLine=false;this.constrainZoomTo="none";this.shapeRenderer=new i.jqplot.ShapeRenderer();this._zoom={start:[],end:[],started:false,zooming:false,isZoomed:false,axes:{start:{},end:{}}};this._tooltipElem;this.zoomCanvas;this.cursorCanvas;this.intersectionThreshold=2;this.showCursorLegend=false;this.cursorLegendFormatString=i.jqplot.Cursor.cursorLegendFormatString;i.extend(true,this,o)};i.jqplot.Cursor.cursorLegendFormatString="%s x:%s, y:%s";i.jqplot.Cursor.init=function(t,r,q){var o=q||{};this.plugins.cursor=new i.jqplot.Cursor(o.cursor);var u=this.plugins.cursor;if(u.show){i.jqplot.eventListenerHooks.push(["jqplotMouseEnter",b]);i.jqplot.eventListenerHooks.push(["jqplotMouseLeave",f]);i.jqplot.eventListenerHooks.push(["jqplotMouseMove",h]);if(u.showCursorLegend){q.legend=q.legend||{};q.legend.renderer=i.jqplot.CursorLegendRenderer;q.legend.formatString=this.plugins.cursor.cursorLegendFormatString;q.legend.show=true}if(u.zoom){i.jqplot.eventListenerHooks.push(["jqplotMouseDown",a]);i.jqplot.eventListenerHooks.push(["jqplotMouseUp",n]);if(u.clickReset){i.jqplot.eventListenerHooks.push(["jqplotClick",j])}if(u.dblClickReset){i.jqplot.eventListenerHooks.push(["jqplotDblClick",c])}}this.resetZoom=function(){var x=this.axes;if(!u.zoomProxy){for(var w in x){x[w].reset()}this.redraw()}else{var v=this.plugins.cursor.zoomCanvas._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height)}this.plugins.cursor._zoom.isZoomed=false;this.target.trigger("jqplotResetZoom",[this,this.plugins.cursor])};if(u.showTooltipDataPosition){u.showTooltipUnitPosition=false;u.showTooltipGridPosition=false;if(o.cursor.tooltipFormatString==undefined){u.tooltipFormatString=i.jqplot.Cursor.cursorLegendFormatString}}}};i.jqplot.Cursor.postDraw=function(){var w=this.plugins.cursor;w.zoomCanvas=new i.jqplot.GenericCanvas();this.eventCanvas._elem.before(w.zoomCanvas.createElement(this._gridPadding,"jqplot-zoom-canvas",this._plotDimensions));var v=w.zoomCanvas.setContext();w._tooltipElem=i('');w.zoomCanvas._elem.before(w._tooltipElem);if(w.showVerticalLine||w.showHorizontalLine){w.cursorCanvas=new i.jqplot.GenericCanvas();this.eventCanvas._elem.before(w.cursorCanvas.createElement(this._gridPadding,"jqplot-cursor-canvas",this._plotDimensions));var v=w.cursorCanvas.setContext()}if(w.showTooltipUnitPosition){if(w.tooltipAxisGroups.length===0){var r=this.series;var t;var o=[];for(var q=0;q6&&Math.abs(w.y-z._zoom.start[1])>6)||(z.constrainZoomTo=="x"&&Math.abs(w.x-z._zoom.start[0])>6)||(z.constrainZoomTo=="y"&&Math.abs(w.y-z._zoom.start[1])>6)){if(!x.plugins.cursor.zoomProxy){for(var o in t){if(z._zoom.axes[o]==undefined){z._zoom.axes[o]={};z._zoom.axes[o].numberTicks=y[o].numberTicks;z._zoom.axes[o].tickInterval=y[o].tickInterval;z._zoom.axes[o].daTickInterval=y[o].daTickInterval;z._zoom.axes[o].min=y[o].min;z._zoom.axes[o].max=y[o].max}if((z.constrainZoomTo=="none")||(z.constrainZoomTo=="x"&&o.charAt(0)=="x")||(z.constrainZoomTo=="y"&&o.charAt(0)=="y")){dp=t[o];if(dp!=null){if(dp>r[o]){y[o].min=r[o];y[o].max=dp}else{span=r[o]-dp;y[o].max=r[o];y[o].min=dp}y[o].tickInterval=null;y[o].daTickInterval=null;y[o]._ticks=[]}}}C.clearRect(0,0,C.canvas.width,C.canvas.height);x.redraw();z._zoom.isZoomed=true}x.target.trigger("jqplotZoom",[w,t,x,B])}};i.jqplot.preInitHooks.push(i.jqplot.Cursor.init);i.jqplot.postDrawHooks.push(i.jqplot.Cursor.postDraw);function e(D,q,A){var F=A.plugins.cursor;var v="";var J=false;if(F.showTooltipGridPosition){v=D.x+", "+D.y;J=true}if(F.showTooltipUnitPosition){var C;for(var B=0;B"}if(F.useAxesFormatters){var z=A.axes[C[0]]._ticks[0].formatter;var o=A.axes[C[1]]._ticks[0].formatter;var G=A.axes[C[0]]._ticks[0].formatString;var u=A.axes[C[1]]._ticks[0].formatString;v+=z(G,q[C[0]])+", "+o(u,q[C[1]])}else{v+=i.jqplot.sprintf(F.tooltipFormatString,q[C[0]],q[C[1]])}J=true}}if(F.showTooltipDataPosition){var t=A.series;var I=d(A,D.x,D.y);var J=false;for(var B=0;B"}v+=i.jqplot.sprintf(F.tooltipFormatString,r,y,w);J=true}}}}F._tooltipElem.html(v)}function g(C,A){var E=A.plugins.cursor;var z=E.cursorCanvas._ctx;z.clearRect(0,0,z.canvas.width,z.canvas.height);if(E.showVerticalLine){E.shapeRenderer.draw(z,[[C.x,0],[C.x,z.canvas.height]])}if(E.showHorizontalLine){E.shapeRenderer.draw(z,[[0,C.y],[z.canvas.width,C.y]])}var G=d(A,C.x,C.y);if(E.showCursorLegend){var q=i(A.targetId+" td.jqplot-cursor-legend-label");for(var B=0;By[0]){q=y[0];o=u[0]-y[0]}else{q=u[0];o=y[0]-u[0]}if(u[1]>y[1]){v=y[1];x=u[1]-y[1]}else{v=u[1];x=y[1]-u[1]}r.fillStyle="rgba(0,0,0,0.2)";r.strokeStyle="#999999";r.lineWidth=1;r.clearRect(0,0,r.canvas.width,r.canvas.height);r.fillRect(0,0,r.canvas.width,r.canvas.height);r.clearRect(q,v,o,x);r.strokeRect(q,v,o,x)}i.jqplot.CursorLegendRenderer=function(o){i.jqplot.TableLegendRenderer.call(this,o);this.formatString="%s"};i.jqplot.CursorLegendRenderer.prototype=new i.jqplot.TableLegendRenderer();i.jqplot.CursorLegendRenderer.prototype.constructor=i.jqplot.CursorLegendRenderer;i.jqplot.CursorLegendRenderer.prototype.draw=function(){if(this.show){var u=this._series;this._elem=i('
');var x=false;for(var t=0;t').appendTo(this._elem);C.data("seriesIndex",y);i('
').appendTo(C);var E=i('');E.appendTo(C);E.data("seriesIndex",y);if(this.escapeHtml){E.text(B)}else{E.html(B)}}return this._elem}})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.dateAxisRenderer.js b/frontend/javascripts/jqplot/plugins/jqplot.dateAxisRenderer.js deleted file mode 100644 index e46bc5b..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.dateAxisRenderer.js +++ /dev/null @@ -1,313 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * The author would appreciate an email letting him know of any substantial - * use of jqPlot. You can reach the author at: chris dot leonello at gmail - * dot com or see http://www.jqplot.com/info.php . This is, of course, - * not required. - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - * - * Thanks for using jqPlot! - * - */ -(function($) { - /** - * Class: $.jqplot.DateAxisRenderer - * A plugin for a jqPlot to render an axis as a series of date values. - * This renderer has no options beyond those supplied by the class. - * It supplies it's own tick formatter, so the tickOptions.formatter option - * should not be overridden. - * - * Thanks to Ken Synder for his enhanced Date instance methods which are - * included with this code . - * - * To use this renderer, include the plugin in your source - * > - * - * and supply the appropriate options to your plot - * - * > {axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}} - * - * Dates can be passed into the axis in almost any recognizable value and - * will be parsed. They will be rendered on the axis in the format - * specified by tickOptions.formatString. e.g. tickOptions.formatString = '%Y-%m-%d'. - * - * Accecptable format codes - * are: - * - * > Code Result Description - * > == Years == - * > %Y 2008 Four-digit year - * > %y 08 Two-digit year - * > == Months == - * > %m 09 Two-digit month - * > %#m 9 One or two-digit month - * > %B September Full month name - * > %b Sep Abbreviated month name - * > == Days == - * > %d 05 Two-digit day of month - * > %#d 5 One or two-digit day of month - * > %e 5 One or two-digit day of month - * > %A Sunday Full name of the day of the week - * > %a Sun Abbreviated name of the day of the week - * > %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday) - * > %o th The ordinal suffix string following the day of the month - * > == Hours == - * > %H 23 Hours in 24-hour format (two digits) - * > %#H 3 Hours in 24-hour integer format (one or two digits) - * > %I 11 Hours in 12-hour format (two digits) - * > %#I 3 Hours in 12-hour integer format (one or two digits) - * > %p PM AM or PM - * > == Minutes == - * > %M 09 Minutes (two digits) - * > %#M 9 Minutes (one or two digits) - * > == Seconds == - * > %S 02 Seconds (two digits) - * > %#S 2 Seconds (one or two digits) - * > %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00) - * > == Milliseconds == - * > %N 008 Milliseconds (three digits) - * > %#N 8 Milliseconds (one to three digits) - * > == Timezone == - * > %O 360 difference in minutes between local time and GMT - * > %Z Mountain Standard Time Name of timezone as reported by browser - * > %G -06:00 Hours and minutes between GMT - * > == Shortcuts == - * > %F 2008-03-26 %Y-%m-%d - * > %T 05:06:30 %H:%M:%S - * > %X 05:06:30 %H:%M:%S - * > %x 03/26/08 %m/%d/%y - * > %D 03/26/08 %m/%d/%y - * > %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y - * > %v 3-Sep-2008 %e-%b-%Y - * > %R 15:31 %H:%M - * > %r 3:31:00 PM %I:%M:%S %p - * > == Characters == - * > %n \n Newline - * > %t \t Tab - * > %% % Percent Symbol - */ - $.jqplot.DateAxisRenderer = function() { - $.jqplot.LinearAxisRenderer.call(this); - }; - - $.jqplot.DateAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); - $.jqplot.DateAxisRenderer.prototype.constructor = $.jqplot.DateAxisRenderer; - - $.jqplot.DateTickFormatter = function(format, val) { - if (!format) { - format = '%Y/%m/%d'; - } - return Date.create(val).strftime(format); - }; - - $.jqplot.DateAxisRenderer.prototype.init = function(options){ - // prop: tickRenderer - // A class of a rendering engine for creating the ticks labels displayed on the plot, - // See <$.jqplot.AxisTickRenderer>. - // this.tickRenderer = $.jqplot.AxisTickRenderer; - // this.labelRenderer = $.jqplot.AxisLabelRenderer; - this.tickOptions.formatter = $.jqplot.DateTickFormatter; - this.daTickInterval = null; - this._daTickInterval = null; - $.extend(true, this, options); - var db = this._dataBounds; - // Go through all the series attached to this axis and find - // the min/max bounds for this axis. - for (var i=0; i db.max || db.max == null) { - db.max = d[j][0]; - } - } - else { - d[j][1] = Date.create(d[j][1]).getTime(); - pd[j][1] = Date.create(d[j][1]).getTime(); - sd[j][1] = Date.create(d[j][1]).getTime(); - if (d[j][1] < db.min || db.min == null) { - db.min = d[j][1]; - } - if (d[j][1] > db.max || db.max == null) { - db.max = d[j][1]; - } - } - } - } - }; - - // called with scope of an axis - $.jqplot.DateAxisRenderer.prototype.reset = function() { - this.min = this._min; - this.max = this._max; - this.tickInterval = this._tickInterval; - this.numberTicks = this._numberTicks; - this.daTickInterval = this._daTickInterval; - // this._ticks = this.__ticks; - }; - - $.jqplot.DateAxisRenderer.prototype.createTicks = function() { - // we're are operating on an axis here - var ticks = this._ticks; - var userTicks = this.ticks; - var name = this.name; - // databounds were set on axis initialization. - var db = this._dataBounds; - var dim, interval; - var min, max; - var pos1, pos2; - var tt, i; - - // if we already have ticks, use them. - // ticks must be in order of increasing value. - - if (userTicks.length) { - // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed - for (i=0; i 200) { - this.numberTicks = parseInt(3+(dim-200)/100, 10); - } - else { - this.numberTicks = 2; - } - } - - if (this.daTickInterval == null) { - this.daTickInterval = [range / (this.numberTicks-1)/1000, 'seconds']; - } - for (var i=0; ic.max||c.max==null){c.max=l[e][0]}}else{l[e][1]=Date.create(l[e][1]).getTime();b[e][1]=Date.create(l[e][1]).getTime();k[e][1]=Date.create(l[e][1]).getTime();if(l[e][1]c.max||c.max==null){c.max=l[e][1]}}}}};a.jqplot.DateAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks;this.daTickInterval=this._daTickInterval};a.jqplot.DateAxisRenderer.prototype.createTicks=function(){var v=this._ticks;var r=this.ticks;var w=this.name;var u=this._dataBounds;var o,s;var m,p;var d,c;var b,q;if(r.length){for(q=0;q200){this.numberTicks=parseInt(3+(o-200)/100,10)}else{this.numberTicks=2}}}if(this.daTickInterval==null){this.daTickInterval=[j/(this.numberTicks-1)/1000,"seconds"]}for(var q=0;q= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]); - drag.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')'; - } - mr.color = drag.color; - mr.init(); - - var start = (neighbor.pointIndex > 0) ? neighbor.pointIndex - 1 : 0; - var end = neighbor.pointIndex+2; - drag._gridData = s.gridData.slice(start, end); - } - - function handleMove(ev, gridpos, datapos, neighbor, plot) { - if (plot.plugins.dragable.dragCanvas.isDragging) { - var dc = plot.plugins.dragable.dragCanvas; - var dp = dc._neighbor; - var s = plot.series[dp.seriesIndex]; - var drag = s.plugins.dragable; - var gd = s.gridData; - - // compute the new grid position with any constraints. - var x = (drag.constrainTo == 'y') ? dp.gridData[0] : gridpos.x; - var y = (drag.constrainTo == 'x') ? dp.gridData[1] : gridpos.y; - - // compute data values for any listeners. - var xu = s._xaxis.series_p2u(x); - var yu = s._yaxis.series_p2u(y); - - // clear the canvas then redraw effect at new position. - var ctx = dc._ctx; - ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); - - // adjust our gridData for the new mouse position - if (dp.pointIndex > 0) { - drag._gridData[1] = [x, y]; - } - else { - drag._gridData[0] = [x, y]; - } - plot.series[dp.seriesIndex].draw(dc._ctx, {gridData:drag._gridData, shadow:false, preventJqPlotSeriesDrawTrigger:true, color:drag.color, markerOptions:{color:drag.color, shadow:false}, trendline:{show:false}}); - plot.target.trigger('jqplotSeriesPointChange', [dp.seriesIndex, dp.pointIndex, [xu,yu], [x,y]]); - } - else if (neighbor != null) { - var series = plot.series[neighbor.seriesIndex]; - if (series.isDragable) { - var dc = plot.plugins.dragable.dragCanvas; - if (!dc.isOver) { - dc._cursors.push(ev.target.style.cursor); - ev.target.style.cursor = "pointer"; - } - dc.isOver = true; - } - } - else if (neighbor == null) { - var dc = plot.plugins.dragable.dragCanvas; - if (dc.isOver) { - ev.target.style.cursor = dc._cursors.pop(); - dc.isOver = false; - } - } - } - - function handleDown(ev, gridpos, datapos, neighbor, plot) { - var dc = plot.plugins.dragable.dragCanvas; - dc._cursors.push(ev.target.style.cursor); - if (neighbor != null) { - var s = plot.series[neighbor.seriesIndex]; - var drag = s.plugins.dragable; - if (s.isDragable && !dc.isDragging) { - dc._neighbor = neighbor; - dc.isDragging = true; - initDragPoint(plot, neighbor); - drag.markerRenderer.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], dc._ctx); - ev.target.style.cursor = "move"; - } - } - // Just in case of a hickup, we'll clear the drag canvas and reset. - else { - var ctx = dc._ctx; - ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); - dc.isDragging = false; - } - } - - function handleUp(ev, gridpos, datapos, neighbor, plot) { - if (plot.plugins.dragable.dragCanvas.isDragging) { - var dc = plot.plugins.dragable.dragCanvas; - // clear the canvas - var ctx = dc._ctx; - ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); - dc.isDragging = false; - // redraw the series canvas at the new point. - var dp = dc._neighbor; - var s = plot.series[dp.seriesIndex]; - var drag = s.plugins.dragable; - // compute the new grid position with any constraints. - var x = (drag.constrainTo == 'y') ? dp.data[0] : datapos[s.xaxis]; - var y = (drag.constrainTo == 'x') ? dp.data[1] : datapos[s.yaxis]; - // var x = datapos[s.xaxis]; - // var y = datapos[s.yaxis]; - s.data[dp.pointIndex] = [x,y]; - plot.drawSeries({preventJqPlotSeriesDrawTrigger:true}, dp.seriesIndex); - dc._neighbor = null; - ev.target.style.cursor = dc._cursors.pop(); - } - } -})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.dragable.min.js b/frontend/javascripts/jqplot/plugins/jqplot.dragable.min.js deleted file mode 100644 index dd13ec3..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.dragable.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * Although not required, the author would appreciate an email letting him - * know of any substantial use of jqPlot. You can reach the author at: - * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - */ -(function(d){d.jqplot.Dragable=function(g){this.markerRenderer=new d.jqplot.MarkerRenderer({shadow:false});this.shapeRenderer=new d.jqplot.ShapeRenderer();this.isDragging=false;this.isOver=false;this._ctx;this._elem;this._point;this._gridData;this.color;this.constrainTo="none";d.extend(true,this,g)};function b(){d.jqplot.GenericCanvas.call(this);this.isDragging=false;this.isOver=false;this._neighbor;this._cursors=[]}b.prototype=new d.jqplot.GenericCanvas();b.prototype.constructor=b;d.jqplot.Dragable.parseOptions=function(i,h){var g=h||{};this.plugins.dragable=new d.jqplot.Dragable(g.dragable);this.isDragable=d.jqplot.config.enablePlugins};d.jqplot.Dragable.postPlotDraw=function(){this.plugins.dragable={previousCursor:"auto",isOver:false};this.plugins.dragable.dragCanvas=new b();this.eventCanvas._elem.before(this.plugins.dragable.dragCanvas.createElement(this._gridPadding,"jqplot-dragable-canvas",this._plotDimensions));var g=this.plugins.dragable.dragCanvas.setContext()};d.jqplot.preParseSeriesOptionsHooks.push(d.jqplot.Dragable.parseOptions);d.jqplot.postDrawHooks.push(d.jqplot.Dragable.postPlotDraw);d.jqplot.eventListenerHooks.push(["jqplotMouseMove",e]);d.jqplot.eventListenerHooks.push(["jqplotMouseDown",c]);d.jqplot.eventListenerHooks.push(["jqplotMouseUp",a]);function f(n,p){var q=n.series[p.seriesIndex];var m=q.plugins.dragable;var h=q.markerRenderer;var i=m.markerRenderer;i.style=h.style;i.lineWidth=h.lineWidth+2.5;i.size=h.size+5;if(!m.color){var l=d.jqplot.getColorComponents(h.color);var o=[l[0],l[1],l[2]];var k=(l[3]>=0.6)?l[3]*0.6:l[3]*(2-l[3]);m.color="rgba("+o[0]+","+o[1]+","+o[2]+","+k+")"}i.color=m.color;i.init();var g=(p.pointIndex>0)?p.pointIndex-1:0;var j=p.pointIndex+2;m._gridData=q.gridData.slice(g,j)}function e(o,l,h,t,m){if(m.plugins.dragable.dragCanvas.isDragging){var u=m.plugins.dragable.dragCanvas;var i=u._neighbor;var w=m.series[i.seriesIndex];var k=w.plugins.dragable;var r=w.gridData;var p=(k.constrainTo=="y")?i.gridData[0]:l.x;var n=(k.constrainTo=="x")?i.gridData[1]:l.y;var g=w._xaxis.series_p2u(p);var q=w._yaxis.series_p2u(n);var v=u._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);if(i.pointIndex>0){k._gridData[1]=[p,n]}else{k._gridData[0]=[p,n]}m.series[i.seriesIndex].draw(u._ctx,{gridData:k._gridData,shadow:false,preventJqPlotSeriesDrawTrigger:true,color:k.color,markerOptions:{color:k.color,shadow:false},trendline:{show:false}});m.target.trigger("jqplotSeriesPointChange",[i.seriesIndex,i.pointIndex,[g,q],[p,n]])}else{if(t!=null){var j=m.series[t.seriesIndex];if(j.isDragable){var u=m.plugins.dragable.dragCanvas;if(!u.isOver){u._cursors.push(o.target.style.cursor);o.target.style.cursor="pointer"}u.isOver=true}}else{if(t==null){var u=m.plugins.dragable.dragCanvas;if(u.isOver){o.target.style.cursor=u._cursors.pop();u.isOver=false}}}}}function c(k,i,g,l,j){var m=j.plugins.dragable.dragCanvas;m._cursors.push(k.target.style.cursor);if(l!=null){var o=j.series[l.seriesIndex];var h=o.plugins.dragable;if(o.isDragable&&!m.isDragging){m._neighbor=l;m.isDragging=true;f(j,l);h.markerRenderer.draw(o.gridData[l.pointIndex][0],o.gridData[l.pointIndex][1],m._ctx);k.target.style.cursor="move"}}else{var n=m._ctx;n.clearRect(0,0,n.canvas.width,n.canvas.height);m.isDragging=false}}function a(m,j,g,o,k){if(k.plugins.dragable.dragCanvas.isDragging){var p=k.plugins.dragable.dragCanvas;var q=p._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);p.isDragging=false;var h=p._neighbor;var r=k.series[h.seriesIndex];var i=r.plugins.dragable;var n=(i.constrainTo=="y")?h.data[0]:g[r.xaxis];var l=(i.constrainTo=="x")?h.data[1]:g[r.yaxis];r.data[h.pointIndex]=[n,l];k.drawSeries({preventJqPlotSeriesDrawTrigger:true},h.seriesIndex);p._neighbor=null;m.target.style.cursor=p._cursors.pop()}}})(jQuery); \ No newline at end of file diff --git a/frontend/javascripts/jqplot/plugins/jqplot.highlighter.js b/frontend/javascripts/jqplot/plugins/jqplot.highlighter.js deleted file mode 100644 index 4e7dca7..0000000 --- a/frontend/javascripts/jqplot/plugins/jqplot.highlighter.js +++ /dev/null @@ -1,359 +0,0 @@ -/** - * Copyright (c) 2009 Chris Leonello - * jqPlot is currently available for use in all personal or commercial projects - * under both the MIT and GPL version 2.0 licenses. This means that you can - * choose the license that best suits your project and use it accordingly. - * - * The author would appreciate an email letting him know of any substantial - * use of jqPlot. You can reach the author at: chris dot leonello at gmail - * dot com or see http://www.jqplot.com/info.php . This is, of course, - * not required. - * - * If you are feeling kind and generous, consider supporting the project by - * making a donation at: http://www.jqplot.com/donate.php . - * - * Thanks for using jqPlot! - * - */ -(function($) { - $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]); - - /** - * Class: $.jqplot.Highlighter - * Plugin which will highlight data points when they are moused over. - * - * To use this plugin, include the js - * file in your source: - * - * > - * - * A tooltip providing information about the data point is enabled by default. - * To disable the tooltip, set "showTooltip" to false. - * - * You can control what data is displayed in the tooltip with various - * options. The "tooltipAxes" option controls wether the x, y or both - * data values are displayed. - * - * Some chart types (e.g. hi-low-close) have more than one y value per - * data point. To display the additional values in the tooltip, set the - * "yvalues" option to the desired number of y values present (3 for a hlc chart). - * - * By default, data values will be formatted with the same formatting - * specifiers as used to format the axis ticks. A custom format code - * can be supplied with the tooltipFormatString option. This will apply - * to all values in the tooltip. - * - * For more complete control, the "formatString" option can be set. This - * Allows conplete control over tooltip formatting. Values are passed to - * the format string in an order determined by the "tooltipAxes" and "yvalues" - * options. So, if you have a hi-low-close chart and you just want to display - * the hi-low-close values in the tooltip, you could set a formatString like: - * - * > highlighter: { - * > tooltipAxes: 'y', - * > yvalues: 3, - * > formatString:' - * > - * > - * >
hi:%s
low:%s
close:%s
' - * > } - * - */ - $.jqplot.Highlighter = function(options) { - // Group: Properties - // - //prop: show - // true to show the highlight. - this.show = $.jqplot.config.enablePlugins; - // prop: markerRenderer - // Renderer used to draw the marker of the highlighted point. - // Renderer will assimilate attributes from the data point being highlighted, - // so no attributes need set on the renderer directly. - // Default is to turn off shadow drawing on the highlighted point. - this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false}); - // prop: showMarker - // true to show the marker - this.showMarker = true; - // prop: lineWidthAdjust - // Pixels to add to the lineWidth of the highlight. - this.lineWidthAdjust = 2.5; - // prop: sizeAdjust - // Pixels to add to the overall size of the highlight. - this.sizeAdjust = 5; - // prop: showTooltip - // Show a tooltip with data point values. - this.showTooltip = true; - // prop: tooltipLocation - // Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' - this.tooltipLocation = 'nw'; - // prop: tooltipFade - // true = fade in/out tooltip, flase = show/hide tooltip - this.fadeTooltip = true; - // prop: tooltipFadeSpeed - // 'slow', 'def', 'fast', or number of milliseconds. - this.tooltipFadeSpeed = "fast"; - // prop: tooltipOffset - // Pixel offset of tooltip from the highlight. - this.tooltipOffset = 2; - // prop: tooltipAxes - // Which axes to display in tooltip, 'x', 'y' or 'both', 'xy' or 'yx' - // 'both' and 'xy' are equivalent, 'yx' reverses order of labels. - this.tooltipAxes = 'both'; - // prop; tooltipSeparator - // String to use to separate x and y axes in tooltip. - this.tooltipSeparator = ', '; - // prop: useAxesFormatters - // Use the x and y axes formatters to format the text in the tooltip. - this.useAxesFormatters = true; - // prop: tooltipFormatString - // sprintf format string for the tooltip. - // Uses Ash Searle's javascript sprintf implementation - // found here: http://hexmen.com/blog/2007/03/printf-sprintf/ - // See http://perldoc.perl.org/functions/sprintf.html for reference. - // Additional "p" and "P" format specifiers added by Chris Leonello. - this.tooltipFormatString = '%.5P'; - // prop: formatString - // alternative to tooltipFormatString - // will format the whole tooltip text, populating with x, y values as - // indicated by tooltipAxes option. So, you could have a tooltip like: - // 'Date: %s, number of cats: %d' to format the whole tooltip at one go. - // If useAxesFormatters is true, values will be formatted according to - // Axes formatters and you can populate your tooltip string with - // %s placeholders. - this.formatString = null; - // prop: yvalues - // Number of y values to expect in the data point array. - // Typically this is 1. Certain plots, like OHLC, will - // have more y values in each data point array. - this.yvalues = 1; - this._tooltipElem; - this.isHighlighting = false; - - $.extend(true, this, options); - }; - - // axis.renderer.tickrenderer.formatter - - // called with scope of plot - $.jqplot.Highlighter.init = function (target, data, opts){ - var options = opts || {}; - // add a highlighter attribute to the plot - this.plugins.highlighter = new $.jqplot.Highlighter(options.highlighter); - }; - - // called within scope of series - $.jqplot.Highlighter.parseOptions = function (defaults, options) { - this.showHighlight = true; - }; - - // called within context of plot - // create a canvas which we can draw on. - // insert it before the eventCanvas, so eventCanvas will still capture events. - $.jqplot.Highlighter.postPlotDraw = function() { - this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas(); - - this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions)); - var hctx = this.plugins.highlighter.highlightCanvas.setContext(); - - var p = this.plugins.highlighter; - p._tooltipElem = $(''); - this.target.append(p._tooltipElem); - }; - - $.jqplot.preInitHooks.push($.jqplot.Highlighter.init); - $.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Highlighter.parseOptions); - $.jqplot.postDrawHooks.push($.jqplot.Highlighter.postPlotDraw); - - function draw(plot, neighbor) { - var hl = plot.plugins.highlighter; - var s = plot.series[neighbor.seriesIndex]; - var smr = s.markerRenderer; - var mr = hl.markerRenderer; - mr.style = smr.style; - mr.lineWidth = smr.lineWidth + hl.lineWidthAdjust; - mr.size = smr.size + hl.sizeAdjust; - var rgba = $.jqplot.getColorComponents(smr.color); - var newrgb = [rgba[0], rgba[1], rgba[2]]; - var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]); - mr.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')'; - mr.init(); - mr.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], hl.highlightCanvas._ctx); - } - - function showTooltip(plot, series, neighbor) { - // neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]} - // gridData should be x,y pixel coords on the grid. - // add the plot._gridPadding to that to get x,y in the target. - var hl = plot.plugins.highlighter; - var elem = hl._tooltipElem; - if (hl.useAxesFormatters) { - var xf = series._xaxis._ticks[0].formatter; - var yf = series._yaxis._ticks[0].formatter; - var xfstr = series._xaxis._ticks[0].formatString; - var yfstr = series._yaxis._ticks[0].formatString; - var str; - var xstr = xf(xfstr, neighbor.data[0]); - var ystrs = []; - for (var i=1; i