var SVG={};SVG.ns="http://www.w3.org/2000/svg";SVG.xlinkns="http://www.w3.org/1999/xlink";SVG.marginBottom=10;SVG.marginTop=15;SVG.marginLeft=10;SVG.marginRight=10;SVG.rounded=false;SVG.x_axis=false;SVG.fill=true;SVG.line="line";SVG.dashed_style="5, 5";SVG.parent_holder=false;SVG.holder=false;SVG.g=false;SVG.axis=false;SVG.graphs=[];SVG.raw_points=[];SVG.x_callback=false;SVG.createElement=function(b,a){var c=document.createElementNS(SVG.ns,b);for(attr in a){c.setAttribute(attr,a[attr])}return c};SVG.hasClass=function(b,a){return(" "+b.getAttribute("class")+" ").indexOf(" "+a+" ")>-1};SVG.addGraph=function(b,a){SVG.graphs[b]=a};SVG.hasGraph=function(a){if(typeof(SVG.graphs[a])==="undefined"){return false}else{return true}};SVG.clearGraph=function(b){if(typeof(b)==="undefined"){SVG.raw_points=[];SVG.graphs=[]}else{for(var a=0;a=0;--g){p[g]=(d[g]-j[g]*p[g+1])/k[g]}for(var g=0;gc||c===false){c=j[p].x}if(j[p].yb||b===false){b=j[p].y}}var f=SVG.getNewXY(g,c,e,b);var i=f(Math.pow(10,Math.floor(Math.log(c-g)/Math.log(10))),Math.pow(10,Math.floor(Math.log(b-e)/Math.log(10))));var o=f(0,0);var n={x:i.x-o.x,y:i.y-o.y};if(SVG.grid==="big"||SVG.grid==="both"){var a=SVG.holder.getElementById("grid");a.setAttribute("width",n.x);a.setAttribute("height",n.y);var h=f(Math.floor(g/Math.pow(10,Math.floor(Math.log(c-g)/Math.log(10))))*Math.pow(10,Math.floor(Math.log(c-g)/Math.log(10))),Math.floor(e/Math.pow(10,Math.floor(Math.log(b-e)/Math.log(10))))*Math.pow(10,Math.floor(Math.log(b-e)/Math.log(10))));a.setAttribute("y",h.y);a.setAttribute("x",h.x);a.querySelector("path").setAttribute("d","M "+n.x+" 0 L 0 0 0 "+n.y);if(SVG.grid==="both"){a.querySelector("rect").setAttribute("width",n.x);a.querySelector("rect").setAttribute("height",n.y)}}if(SVG.grid==="small"||SVG.grid==="both"){n.x=n.x/10;n.y=n.y/10;var a=SVG.holder.getElementById("smallGrid");a.setAttribute("width",n.x);a.setAttribute("height",n.y);if(SVG.grid==="small"){var m=f(Math.floor(g/Math.pow(10,Math.floor(Math.log(c-g)/Math.log(10))))*Math.pow(10,Math.floor(Math.log(c-g)/Math.log(10))),Math.floor(e/Math.pow(10,Math.floor(Math.log(b-e)/Math.log(10))))*Math.pow(10,Math.floor(Math.log(b-e)/Math.log(10))));a.setAttribute("y",m.y);a.setAttribute("x",m.x)}a.querySelector("path").setAttribute("d","M "+n.x+" 0 L 0 0 0 "+n.y)}if(SVG.x_axis===true){y=f(0,0).y;SVG.axis.setAttribute("y1",y);SVG.axis.setAttribute("y2",y)}return f};SVG.draw=function(){var A=SVG.scale(SVG.raw_points);var t=[],p;var n,m;var d;for(var r=0;r","").split("");for(var u=0;u]+)>)/ig,"").replace("%y",SVG.raw_points[r].y).replace("%x",SVG.raw_points[r].x);if(u%2==0){d.appendChild(document.createTextNode(l[u]))}else{var w=SVG.createElement("tspan",{dy:"-5"});w.appendChild(document.createTextNode(l[u]));d.appendChild(w)}}p=SVG.createElement("path",{stroke:"black","stroke-width":2,fill:"white",opacity:0.5});v.appendChild(p);v.appendChild(d);var z=j[r].x-d.getBoundingClientRect().width/2;var a=SVG.parent_holder.offsetHeight-j[r].y-20;var f=d.getBoundingClientRect().width;var s=d.getBoundingClientRect().height;if(j[r].x-d.getBoundingClientRect().width/2<0){z=j[r].x+20;a=SVG.parent_holder.offsetHeight-j[r].y+5;p.setAttribute("d","M "+(z-5)+" "+(a+5)+" L "+(z-5)+" "+(a-s/2+7.5)+" L "+(z-10)+" "+(a-s/2+5)+" L "+(z-5)+" "+(a-s/2+2.5)+" L "+(z-5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a+5)+" Z")}else{if(j[r].y+d.getBoundingClientRect().height+12>SVG.parent_holder.offsetHeight){z=j[r].x+20;a=SVG.parent_holder.offsetHeight-j[r].y+5;p.setAttribute("d","M "+(z-5)+" "+(a+5)+" L "+(z-5)+" "+(a-s/2+7.5)+" L "+(z-10)+" "+(a-s/2+5)+" L "+(z-5)+" "+(a-s/2+2.5)+" L "+(z-5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a+5)+" Z");if(z+f>SVG.parent_holder.offsetWidth){z=j[r].y-f-20;a=SVG.parent_holder.offsetHeight-j[r].y+5;p.setAttribute("d","M "+(z-5)+" "+(a+5)+" L "+(z-5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s/2+2.5)+" L "+(z+f+10)+" "+(a-s/2+5)+" L "+(z+f+5)+" "+(a-s/2+7.5)+" L "+(z+f+5)+" "+(a+5)+" Z")}}else{if(j[r].x+f/2+12>SVG.parent_holder.offsetWidth){z=j[r].x-f-20;a=SVG.parent_holder.offsetHeight-j[r].y+5;p.setAttribute("d","M "+(z-5)+" "+(a+5)+" L "+(z-5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s/2+2.5)+" L "+(z+f+10)+" "+(a-s/2+5)+" L "+(z+f+5)+" "+(a-s/2+7.5)+" L "+(z+f+5)+" "+(a+5)+" Z")}else{p.setAttribute("d","M "+(z-5)+" "+(a+5)+" L "+(z-5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a-s+5)+" L "+(z+f+5)+" "+(a+5)+" L "+(z+f/2+2.5)+" "+(a+5)+" L "+(z+f/2)+" "+(a+10)+" L "+(z+f/2-2.5)+" "+(a+5)+" Z")}}}d.setAttribute("x",z);d.setAttribute("y",a);v.setAttribute("display","none")}}}for(var r=0;rt.length){break}e.push(u);u++;q=t[u].x}}var o=0;if(r>0){u=r-1;o=t[u].x;while(o==t[r].x){if(u<0){break}e.push(u);u--;o=t[u].x}}if(r==0){b.setAttribute("x",0)}else{b.setAttribute("x",(t[r].x+o)/2)}if(r==t.length-1){b.setAttribute("width",SVG.parent_holder.offsetWidth-(t[r].x+t[r-1].x)/2)}else{if(r==0){b.setAttribute("width",(t[1].x+t[0].x)/2+SVG.marginLeft)}else{b.setAttribute("width",(q-o)/2)}}SVG.g.appendChild(b);b.addEventListener("mouseover",(function(g){return function(){[].forEach.call(SVG.holder.querySelectorAll(".point"),function(i){i.setAttribute("r","4")});[].forEach.call(SVG.holder.querySelectorAll(".label"),function(i){i.setAttribute("display","none")});for(var x=0;x