All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.js.flot.jquery.flot.min.js Maven / Gradle / Ivy

There is a newer version: 5.0.4
Show newest version
/*! Javascript plotting library for jQuery, version 0.8 alpha.
 *
 * Released under the MIT license by IOLA, December 2007.
 *
 */
(function(b){b.color={};b.color.make=function(d,e,g,f){var c={};c.r=d||0;c.g=e||0;c.b=g||0;c.a=f!=null?f:1;c.add=function(h,i){for(var j=0;j=1){return"rgb("+[c.r,c.g,c.b].join(",")+")"}else{return"rgba("+[c.r,c.g,c.b,c.a].join(",")+")"}};c.normalize=function(){function h(j,i,k){return ik?k:i)}c.r=h(0,parseInt(c.r),255);c.g=h(0,parseInt(c.g),255);c.b=h(0,parseInt(c.b),255);c.a=h(0,c.a,1);return c};c.clone=function(){return b.color.make(c.r,c.b,c.g,c.a)};return c.normalize()};b.color.extract=function(d,e){var c;do{c=d.css(e).toLowerCase();if(c!=""&&c!="transparent"){break}d=d.parent()}while(!b.nodeName(d.get(0),"body"));if(c=="rgba(0, 0, 0, 0)"){c="transparent"}return b.color.parse(c)};b.color.parse=function(c){var d,f=b.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)){return f(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10))}if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)){return f(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]))}if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)){return f(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55)}if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)){return f(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55,parseFloat(d[4]))}if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)){return f(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16))}if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)){return f(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16))}var e=b.trim(c).toLowerCase();if(e=="transparent"){return f(255,255,255,0)}else{d=a[e]||[0,0,0];return f(d[0],d[1],d[2])}};var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(c){function b(aw,aj,H,ag){var P=[],N={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,timezone:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:0.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1000/60},hooks:{}},aA=null,ae=null,w=null,F=null,y=null,n=[],ax=[],o={left:0,right:0,top:0,bottom:0},E=0,G=0,h=0,u=0,al={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},ar=this;ar.setData=ak;ar.setupGrid=r;ar.draw=W;ar.getPlaceholder=function(){return aw};ar.getCanvas=function(){return aA};ar.getPlotOffset=function(){return o};ar.width=function(){return h};ar.height=function(){return u};ar.offset=function(){var aC=w.offset();aC.left+=o.left;aC.top+=o.top;return aC};ar.getData=function(){return P};ar.getAxes=function(){var aD={},aC;c.each(n.concat(ax),function(aE,aF){if(aF){aD[aF.direction+(aF.n!=1?aF.n:"")+"axis"]=aF}});return aD};ar.getXAxes=function(){return n};ar.getYAxes=function(){return ax};ar.c2p=A;ar.p2c=at;ar.getOptions=function(){return N};ar.highlight=v;ar.unhighlight=T;ar.triggerRedrawOverlay=f;ar.pointOffset=function(aC){return{left:parseInt(n[aB(aC,"x")-1].p2c(+aC.x)+o.left),top:parseInt(ax[aB(aC,"y")-1].p2c(+aC.y)+o.top)}};ar.shutdown=ah;ar.resize=function(){z();g(aA);g(ae)};ar.hooks=al;D(ar);Z(H);X();ak(aj);r();W();ai();function ao(aE,aC){aC=[ar].concat(aC);for(var aD=0;aDaE){aE=aK}}}if(aE>aN){aN=aE+1}var aJ,aC=[],aI=N.colors,aH=aI.length,aD=0;for(aF=0;aF=0){if(aD<0.5){aD=-aD-0.2}else{aD=0}}else{aD=-aD}}aC[aF]=aJ.scale("rgb",1+aD)}var aG=0,aO;for(aF=0;aFa4.datamax&&a2!=aC){a4.datamax=a2}}c.each(k(),function(a2,a3){a3.datamin=aP;a3.datamax=aJ;a3.used=false});for(aV=0;aV0&&aU[aS-aQ]!=null&&aU[aS-aQ]!=aU[aS]&&aU[aS-aQ+1]!=aU[aS+1]){for(aO=0;aOaN){aN=a1}}if(aY.y){if(a1aW){aW=a1}}}}if(aK.bars.show){var aZ;switch(aK.bars.align){case"left":aZ=0;break;case"right":aZ=-aK.bars.barWidth;break;case"center":aZ=-aK.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+aK.bars.align)}if(aK.bars.horizontal){aR+=aZ;aW+=aZ+aK.bars.barWidth}else{aL+=aZ;aN+=aZ+aK.bars.barWidth}}aG(aK.xaxis,aL,aN);aG(aK.yaxis,aR,aW)}c.each(k(),function(a2,a3){if(a3.datamin==aP){a3.datamin=null}if(a3.datamax==aJ){a3.datamax=null}})}function ad(aC){if(window.devicePixelRatio>1&&(aC.webkitBackingStorePixelRatio===undefined||aC.webkitBackingStorePixelRatio<2)){return window.devicePixelRatio}return 1}function i(aC,aE){var aG=document.createElement("canvas");aG.className=aE;if(!aC){c(aG).css({position:"absolute",left:0,top:0})}c(aG).appendTo(aw);if(!aG.getContext){aG=window.G_vmlCanvasManager.initElement(aG)}var aD=aG.getContext("2d");var aF=ad(aD);aG.width=E*aF;aG.height=G*aF;aG.style.width=E+"px";aG.style.height=G+"px";aD.save();aD.scale(aF,aF);return aG}function z(){E=aw.width();G=aw.height();if(E<=0||G<=0){throw new Error("Invalid dimensions for plot, width = "+E+", height = "+G)}}function g(aE){var aC=aE.getContext("2d");var aD=ad(aC);if(aE.style.width!=E){aE.width=E*aD;aE.style.width=E+"px"}if(aE.style.height!=G){aE.height=G*aD;aE.style.height=G+"px"}aC.restore();aC.save();aC.scale(aD,aD)}function X(){var aD,aC=aw.children("canvas.flot-base"),aE=aw.children("canvas.flot-overlay");if(aC.length==0||aE==0){aw.html("");aw.css({padding:0});if(aw.css("position")=="static"){aw.css("position","relative")}z();aA=i(true,"flot-base");ae=i(false,"flot-overlay");aD=false}else{aA=aC.get(0);ae=aE.get(0);aD=true}F=aA.getContext("2d");y=ae.getContext("2d");w=c(ae);if(aD){aw.data("plot").shutdown();ar.resize();y.clearRect(0,0,E,G);w.unbind();aw.children().not([aA,ae]).remove()}aw.data("plot",ar)}function ai(){if(N.grid.hoverable){w.mousemove(aa);w.mouseleave(j)}if(N.grid.clickable){w.click(Q)}ao(al.bindEvents,[w])}function ah(){if(K){clearTimeout(K)}w.unbind("mousemove",aa);w.unbind("mouseleave",j);w.unbind("click",Q);ao(al.shutdown,[w])}function p(aH){function aD(aI){return aI}var aG,aC,aE=aH.options.transform||aD,aF=aH.options.inverseTransform;if(aH.direction=="x"){aG=aH.scale=h/Math.abs(aE(aH.max)-aE(aH.min));aC=Math.min(aE(aH.max),aE(aH.min))}else{aG=aH.scale=u/Math.abs(aE(aH.max)-aE(aH.min));aG=-aG;aC=Math.max(aE(aH.max),aE(aH.min))}if(aE==aD){aH.p2c=function(aI){return(aI-aC)*aG}}else{aH.p2c=function(aI){return(aE(aI)-aC)*aG}}if(!aF){aH.c2p=function(aI){return aC+aI/aG}}else{aH.c2p=function(aI){return aF(aC+aI/aG)}}}function J(aE){var aC=aE.options,aJ=aE.ticks||[],aK=aC.labelWidth||0,aI=aC.labelHeight||0,aH=aE.font;F.save();F.font=aH.style+" "+aH.variant+" "+aH.weight+" "+aH.size+"px '"+aH.family+"'";for(var aG=0;aG|\r\n|\r/g,"\n").split("\n");for(var aF=0;aF=0;--aE){av(aC[aE])}L();c.each(aC,function(aJ,aK){U(aK)})}h=E-o.left-o.right;u=G-o.bottom-o.top;c.each(aH,function(aJ,aK){p(aK)});m()}function l(aF){var aG=aF.options,aE=+(aG.min!=null?aG.min:aF.datamin),aC=+(aG.max!=null?aG.max:aF.datamax),aI=aC-aE;if(aI==0){var aD=aC==0?1:0.01;if(aG.min==null){aE-=aD}if(aG.max==null||aG.min!=null){aC+=aD}}else{var aH=aG.autoscaleMargin;if(aH!=null){if(aG.min==null){aE-=aI*aH;if(aE<0&&aF.datamin!=null&&aF.datamin>=0){aE=0}}if(aG.max==null){aC+=aI*aH;if(aC>0&&aF.datamax!=null&&aF.datamax<=0){aC=0}}}}aF.min=aE;aF.max=aC}function R(aH){var aD=aH.options;var aG;if(typeof aD.ticks=="number"&&aD.ticks>0){aG=aD.ticks}else{aG=0.3*Math.sqrt(aH.direction=="x"?E:G)}aH.delta=(aH.max-aH.min)/aG;if(aD.mode=="time"&&!aH.tickGenerator){throw new Error("Time mode requires the flot.time plugin.")}if(!aH.tickGenerator){var aF=aD.tickDecimals;var aI=-Math.floor(Math.log(aH.delta)/Math.LN10);if(aF!=null&&aI>aF){aI=aF}var aC=Math.pow(10,-aI);var aE=aH.delta/aC;var aN;if(aE<1.5){aN=1}else{if(aE<3){aN=2;if(aE>2.25&&(aF==null||aI+1<=aF)){aN=2.5;++aI}}else{if(aE<7.5){aN=5}else{aN=10}}}aN*=aC;if(aD.minTickSize!=null&&aN0){if(aD.min==null){aH.min=Math.min(aH.min,aM[0])}if(aD.max==null&&aM.length>1){aH.max=Math.max(aH.max,aM[aM.length-1])}}aH.tickGenerator=function(aQ){var aR=[],aO,aP;for(aP=0;aP1&&/\..*0$/.test((aK[1]-aK[0]).toFixed(aL)))){aH.tickDecimals=aL}}}}}function O(aG){var aI=aG.options.ticks,aH=[];if(aI==null||(typeof aI=="number"&&aI>0)){aH=aG.tickGenerator(aG)}else{if(aI){if(c.isFunction(aI)){aH=aI(aG)}else{aH=aI}}}var aF,aC;aG.ticks=[];for(aF=0;aF1){aD=aE[1]}}else{aC=+aE}if(aD==null){aD=aG.tickFormatter(aC,aG)}if(!isNaN(aC)){aG.ticks.push({v:aC,label:aD})}}}function aq(aC,aD){if(aC.options.autoscaleMargin&&aD.length>0){if(aC.options.min==null){aC.min=Math.min(aC.min,aD[0].v)}if(aC.options.max==null&&aD.length>1){aC.max=Math.max(aC.max,aD[aD.length-1].v)}}}function W(){F.clearRect(0,0,E,G);ao(al.drawBackground,[F]);var aD=N.grid;if(aD.show&&aD.backgroundColor){M()}if(aD.show&&!aD.aboveData){ac();S()}for(var aC=0;aCaJ){var aE=aI;aI=aJ;aJ=aE}return{from:aI,to:aJ,axis:aD}}function M(){F.save();F.translate(o.left,o.top);F.fillStyle=an(N.grid.backgroundColor,u,0,"rgba(255, 255, 255, 0)");F.fillRect(0,0,h,u);F.restore()}function ac(){var aG;F.save();F.translate(o.left,o.top);var aI=N.grid.markings;if(aI){if(c.isFunction(aI)){var aL=ar.getAxes();aL.xmin=aL.xaxis.min;aL.xmax=aL.xaxis.max;aL.ymin=aL.yaxis.min;aL.ymax=aL.yaxis.max;aI=aI(aL)}for(aG=0;aGaD.axis.max||aJ.toaJ.axis.max){continue}aD.from=Math.max(aD.from,aD.axis.min);aD.to=Math.min(aD.to,aD.axis.max);aJ.from=Math.max(aJ.from,aJ.axis.min);aJ.to=Math.min(aJ.to,aJ.axis.max);if(aD.from==aD.to&&aJ.from==aJ.to){continue}aD.from=aD.axis.p2c(aD.from);aD.to=aD.axis.p2c(aD.to);aJ.from=aJ.axis.p2c(aJ.from);aJ.to=aJ.axis.p2c(aJ.to);if(aD.from==aD.to||aJ.from==aJ.to){F.beginPath();F.strokeStyle=aE.color||N.grid.markingsColor;F.lineWidth=aE.lineWidth||N.grid.markingsLineWidth;F.moveTo(aD.from,aJ.from);F.lineTo(aD.to,aJ.to);F.stroke()}else{F.fillStyle=aE.color||N.grid.markingsColor;F.fillRect(aD.from,aJ.to,aD.to-aD.from,aJ.from-aJ.to)}}}var aL=k(),aN=N.grid.borderWidth;for(var aF=0;aFaC.max||(aR=="full"&&aN>0&&(aP==aC.min||aP==aC.max))){continue}if(aC.direction=="x"){aO=aC.p2c(aP);aK=aR=="full"?-u:aR;if(aC.position=="top"){aK=-aK}}else{aM=aC.p2c(aP);aQ=aR=="full"?-h:aR;if(aC.position=="left"){aQ=-aQ}}if(F.lineWidth==1){if(aC.direction=="x"){aO=Math.floor(aO)+0.5}else{aM=Math.floor(aM)+0.5}}F.moveTo(aO,aM);F.lineTo(aO+aQ,aM+aK)}F.stroke()}if(aN){F.lineWidth=aN;F.strokeStyle=N.grid.borderColor;F.strokeRect(-aN/2,-aN/2,h+aN,u+aN)}F.restore()}function S(){F.save();c.each(k(),function(aL,aC){if(!aC.show||aC.ticks.length==0){return}var aG=aC.box,aI=aC.font;F.fillStyle=aC.options.color;F.font=aI.style+" "+aI.variant+" "+aI.weight+" "+aI.size+"px "+aI.family;F.textAlign="start";F.textBaseline="middle";for(var aF=0;aFaC.max){continue}var aK,aJ,aE=0,aM;for(var aD=0;aD=aS&&aT>aU.max){if(aS>aU.max){continue}aM=(aU.max-aT)/(aS-aT)*(aL-aM)+aM;aT=aU.max}else{if(aS>=aT&&aS>aU.max){if(aT>aU.max){continue}aL=(aU.max-aT)/(aS-aT)*(aL-aM)+aM;aS=aU.max}}if(aM<=aL&&aM=aL&&aM>aV.max){if(aL>aV.max){continue}aT=(aV.max-aM)/(aL-aM)*(aS-aT)+aT;aM=aV.max}else{if(aL>=aM&&aL>aV.max){if(aM>aV.max){continue}aS=(aV.max-aM)/(aL-aM)*(aS-aT)+aT;aL=aV.max}}if(aM!=aO||aT!=aN){F.moveTo(aV.p2c(aM)+aR,aU.p2c(aT)+aJ)}aO=aL;aN=aS;F.lineTo(aV.p2c(aL)+aR,aU.p2c(aS)+aJ)}F.stroke()}function aG(aJ,aR,aQ){var aX=aJ.points,aW=aJ.pointsize,aO=Math.min(Math.max(0,aQ.min),aQ.max),aY=0,aV,aU=false,aN=1,aM=0,aS=0;while(true){if(aW>0&&aY>aX.length+aW){break}aY+=aW;var a0=aX[aY-aW],aL=aX[aY-aW+aN],aZ=aX[aY],aK=aX[aY+aN];if(aU){if(aW>0&&a0!=null&&aZ==null){aS=aY;aW=-aW;aN=2;continue}if(aW<0&&aY==aM+aW){F.fill();aU=false;aW=-aW;aN=1;aY=aM=aS+aW;continue}}if(a0==null||aZ==null){continue}if(a0<=aZ&&a0=aZ&&a0>aR.max){if(aZ>aR.max){continue}aL=(aR.max-a0)/(aZ-a0)*(aK-aL)+aL;a0=aR.max}else{if(aZ>=a0&&aZ>aR.max){if(a0>aR.max){continue}aK=(aR.max-a0)/(aZ-a0)*(aK-aL)+aL;aZ=aR.max}}if(!aU){F.beginPath();F.moveTo(aR.p2c(a0),aQ.p2c(aO));aU=true}if(aL>=aQ.max&&aK>=aQ.max){F.lineTo(aR.p2c(a0),aQ.p2c(aQ.max));F.lineTo(aR.p2c(aZ),aQ.p2c(aQ.max));continue}else{if(aL<=aQ.min&&aK<=aQ.min){F.lineTo(aR.p2c(a0),aQ.p2c(aQ.min));F.lineTo(aR.p2c(aZ),aQ.p2c(aQ.min));continue}}var aP=a0,aT=aZ;if(aL<=aK&&aL=aQ.min){a0=(aQ.min-aL)/(aK-aL)*(aZ-a0)+a0;aL=aQ.min}else{if(aK<=aL&&aK=aQ.min){aZ=(aQ.min-aL)/(aK-aL)*(aZ-a0)+a0;aK=aQ.min}}if(aL>=aK&&aL>aQ.max&&aK<=aQ.max){a0=(aQ.max-aL)/(aK-aL)*(aZ-a0)+a0;aL=aQ.max}else{if(aK>=aL&&aK>aQ.max&&aL<=aQ.max){aZ=(aQ.max-aL)/(aK-aL)*(aZ-a0)+a0;aK=aQ.max}}if(a0!=aP){F.lineTo(aR.p2c(aP),aQ.p2c(aL))}F.lineTo(aR.p2c(a0),aQ.p2c(aL));F.lineTo(aR.p2c(aZ),aQ.p2c(aK));if(aZ!=aT){F.lineTo(aR.p2c(aZ),aQ.p2c(aK));F.lineTo(aR.p2c(aT),aQ.p2c(aK))}}}F.save();F.translate(o.left,o.top);F.lineJoin="round";var aH=aF.lines.lineWidth,aC=aF.shadowSize;if(aH>0&&aC>0){F.lineWidth=aC;F.strokeStyle="rgba(0,0,0,0.1)";var aI=Math.PI/18;aE(aF.datapoints,Math.sin(aI)*(aH/2+aC/2),Math.cos(aI)*(aH/2+aC/2),aF.xaxis,aF.yaxis);F.lineWidth=aC/2;aE(aF.datapoints,Math.sin(aI)*(aH/2+aC/4),Math.cos(aI)*(aH/2+aC/4),aF.xaxis,aF.yaxis)}F.lineWidth=aH;F.strokeStyle=aF.color;var aD=af(aF.lines,aF.color,0,u);if(aD){F.fillStyle=aD;aG(aF.datapoints,aF.xaxis,aF.yaxis)}if(aH>0){aE(aF.datapoints,0,0,aF.xaxis,aF.yaxis)}F.restore()}function ap(aF){function aI(aO,aN,aV,aL,aT,aU,aR,aK){var aS=aO.points,aJ=aO.pointsize;for(var aM=0;aMaU.max||aPaR.max){continue}F.beginPath();aQ=aU.p2c(aQ);aP=aR.p2c(aP)+aL;if(aK=="circle"){F.arc(aQ,aP,aN,0,aT?Math.PI:Math.PI*2,false)}else{aK(F,aQ,aP,aN,aT)}F.closePath();if(aV){F.fillStyle=aV;F.fill()}F.stroke()}}F.save();F.translate(o.left,o.top);var aH=aF.points.lineWidth,aD=aF.shadowSize,aC=aF.points.radius,aG=aF.points.symbol;if(aH>0&&aD>0){var aE=aD/2;F.lineWidth=aE;F.strokeStyle="rgba(0,0,0,0.1)";aI(aF.datapoints,aC,null,aE+aE/2,true,aF.xaxis,aF.yaxis,aG);F.strokeStyle="rgba(0,0,0,0.2)";aI(aF.datapoints,aC,null,aE/2,true,aF.xaxis,aF.yaxis,aG)}F.lineWidth=aH;F.strokeStyle=aF.color;aI(aF.datapoints,aC,af(aF.points,aF.color),0,false,aF.xaxis,aF.yaxis,aG);F.restore()}function C(aO,aN,aW,aJ,aR,aG,aE,aM,aL,aV,aS,aD){var aF,aU,aK,aQ,aH,aC,aP,aI,aT;if(aS){aI=aC=aP=true;aH=false;aF=aW;aU=aO;aQ=aN+aJ;aK=aN+aR;if(aUaM.max||aQaL.max){return}if(aFaM.max){aU=aM.max;aC=false}if(aKaL.max){aQ=aL.max;aP=false}aF=aM.p2c(aF);aK=aL.p2c(aK);aU=aM.p2c(aU);aQ=aL.p2c(aQ);if(aE){aV.beginPath();aV.moveTo(aF,aK);aV.lineTo(aF,aQ);aV.lineTo(aU,aQ);aV.lineTo(aU,aK);aV.fillStyle=aE(aK,aQ);aV.fill()}if(aD>0&&(aH||aC||aP||aI)){aV.beginPath();aV.moveTo(aF,aK+aG);if(aH){aV.lineTo(aF,aQ+aG)}else{aV.moveTo(aF,aQ+aG)}if(aP){aV.lineTo(aU,aQ+aG)}else{aV.moveTo(aU,aQ+aG)}if(aC){aV.lineTo(aU,aK+aG)}else{aV.moveTo(aU,aK+aG)}if(aI){aV.lineTo(aF,aK+aG)}else{aV.moveTo(aF,aK+aG)}aV.stroke()}}function e(aE){function aD(aK,aJ,aM,aH,aL,aO,aN){var aP=aK.points,aG=aK.pointsize;for(var aI=0;aI")}aK.push("");aI=true}aK.push('
'+entry.label+"")}if(aI){aK.push("")}if(aK.length==0){return}var aO=''+aK.join("")+"
";if(N.legend.container!=null){c(N.legend.container).html(aO)}else{var aL="",aD=N.legend.position,aE=N.legend.margin;if(aE[0]==null){aE=[aE,aE]}if(aD.charAt(0)=="n"){aL+="top:"+(aE[1]+o.top)+"px;"}else{if(aD.charAt(0)=="s"){aL+="bottom:"+(aE[1]+o.bottom)+"px;"}}if(aD.charAt(1)=="e"){aL+="right:"+(aE[0]+o.right)+"px;"}else{if(aD.charAt(1)=="w"){aL+="left:"+(aE[0]+o.left)+"px;"}}var aN=c('
'+aO.replace('style="','style="position:absolute;'+aL+";")+"
").appendTo(aw);if(N.legend.backgroundOpacity!=0){var aJ=N.legend.backgroundColor;if(aJ==null){aJ=N.grid.backgroundColor;if(aJ&&typeof aJ=="string"){aJ=c.color.parse(aJ)}else{aJ=c.color.extract(aN,"background-color")}aJ.a=1;aJ=aJ.toString()}var aC=aN.children();c('
').prependTo(aN).css("opacity",N.legend.backgroundOpacity)}}}var ab=[],K=null;function I(aJ,aH,aE){var aP=N.grid.mouseActiveRadius,a1=aP*aP+1,aZ=null,aS=false,aX,aV;for(aX=P.length-1;aX>=0;--aX){if(!aE(P[aX])){continue}var aQ=P[aX],aI=aQ.xaxis,aG=aQ.yaxis,aW=aQ.datapoints.points,aU=aQ.datapoints.pointsize,aR=aI.c2p(aJ),aO=aG.c2p(aH),aD=aP/aI.scale,aC=aP/aG.scale;if(aI.options.inverseTransform){aD=Number.MAX_VALUE}if(aG.options.inverseTransform){aC=Number.MAX_VALUE}if(aQ.lines.show||aQ.points.show){for(aV=0;aVaD||aL-aR<-aD||aK-aO>aC||aK-aO<-aC){continue}var aN=Math.abs(aI.p2c(aL)-aJ),aM=Math.abs(aG.p2c(aK)-aH),aT=aN*aN+aM*aM;if(aT=Math.min(a0,aL)&&aO>=aK+aF&&aO<=aK+aY):(aR>=aL+aF&&aR<=aL+aY&&aO>=Math.min(a0,aK)&&aO<=Math.max(a0,aK))){aZ=[aX,aV/aU]}}}}if(aZ){aX=aZ[0];aV=aZ[1];aU=P[aX].datapoints.pointsize;return{datapoint:P[aX].datapoints.points.slice(aV*aU,(aV+1)*aU),dataIndex:aV,series:P[aX],seriesIndex:aX}}return null}function aa(aC){if(N.grid.hoverable){s("plothover",aC,function(aD){return aD.hoverable!=false})}}function j(aC){if(N.grid.hoverable){s("plothover",aC,function(aD){return false})}}function Q(aC){s("plotclick",aC,function(aD){return aD.clickable!=false})}function s(aD,aC,aE){var aF=w.offset(),aI=aC.pageX-aF.left-o.left,aG=aC.pageY-aF.top-o.top,aK=A({left:aI,top:aG});aK.pageX=aC.pageX;aK.pageY=aC.pageY;var aL=I(aI,aG,aE);if(aL){aL.pageX=parseInt(aL.series.xaxis.p2c(aL.datapoint[0])+aF.left+o.left);aL.pageY=parseInt(aL.series.yaxis.p2c(aL.datapoint[1])+aF.top+o.top)}if(N.grid.autoHighlight){for(var aH=0;aHaI.max||aJaH.max){return}var aG=aF.points.radius+aF.points.lineWidth/2;y.lineWidth=aG;y.strokeStyle=highlightColor;var aC=1.5*aG,aD=aI.p2c(aD),aJ=aH.p2c(aJ);y.beginPath();if(aF.points.symbol=="circle"){y.arc(aD,aJ,aC,0,2*Math.PI,false)}else{aF.points.symbol(y,aD,aJ,aC,false)}y.closePath();y.stroke()}function t(aF,aC){var aG=(typeof aF.highlightColor==="string")?aF.highlightColor:c.color.parse(aF.color).scale("a",0.5).toString(),aE=aG,aD=aF.bars.align=="left"?0:-aF.bars.barWidth/2;y.lineWidth=aF.bars.lineWidth;y.strokeStyle=aG;C(aC[0],aC[1],aC[2]||0,aD,aD+aF.bars.barWidth,0,function(){return aE},aF.xaxis,aF.yaxis,y,aF.bars.horizontal,aF.bars.lineWidth)}function an(aK,aC,aI,aD){if(typeof aK=="string"){return aK}else{var aJ=F.createLinearGradient(0,aI,0,aC);for(var aF=0,aE=aK.colors.length;aF




© 2015 - 2024 Weber Informatics LLC | Privacy Policy