typeof RGraph=="undefined"&&(RGraph={}),RGraph.Rose=function(n,t){var r,i;for(this.id=n,this.canvas=document.getElementById(n),this.context=this.canvas.getContext("2d"),this.data=t,this.canvas.__object__=this,this.type="rose",this.isRGraph=!0,this.uid=RGraph.CreateUID(),this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID(),this.colorsParsed=!1,RGraph.OldBrowserCompat(this.context),this.centerx=0,this.centery=0,this.radius=0,this.max=0,this.angles=[],this.properties={"chart.background.axes":!0,"chart.background.axes.color":"black","chart.background.grid":!0,"chart.background.grid.color":"#ccc","chart.background.grid.size":null,"chart.background.grid.spokes":null,"chart.background.grid.count":5,"chart.centerx":null,"chart.centery":null,"chart.radius":null,"chart.colors":["rgba(255,0,0,0.5)","rgba(255,255,0,0.5)","rgba(0,255,255,0.5)","rgb(0,255,0)","gray","blue","rgb(255,128,255)","green","pink","gray","aqua"],"chart.colors.sequential":!1,"chart.colors.alpha":null,"chart.margin":0,"chart.strokestyle":"#aaa","chart.gutter.left":25,"chart.gutter.right":25,"chart.gutter.top":25,"chart.gutter.bottom":25,"chart.title":"","chart.title.background":null,"chart.title.hpos":null,"chart.title.vpos":null,"chart.title.bold":!0,"chart.title.font":null,"chart.title.x":null,"chart.title.y":null,"chart.title.halign":null,"chart.title.valign":null,"chart.labels":null,"chart.labels.position":"center","chart.labels.axes":"nsew","chart.labels.offset":0,"chart.text.color":"black","chart.text.font":"Arial","chart.text.size":10,"chart.key":null,"chart.key.background":"white","chart.key.position":"graph","chart.key.halign":"right","chart.key.shadow":!1,"chart.key.shadow.color":"#666","chart.key.shadow.blur":3,"chart.key.shadow.offsetx":2,"chart.key.shadow.offsety":2,"chart.key.position.gutter.boxed":!0,"chart.key.position.x":null,"chart.key.position.y":null,"chart.key.color.shape":"square","chart.key.rounded":!0,"chart.key.linewidth":1,"chart.key.colors":null,"chart.contextmenu":null,"chart.tooltips":null,"chart.tooltips.event":"onclick","chart.tooltips.effect":"fade","chart.tooltips.css.class":"RGraph_tooltip","chart.tooltips.highlight":!0,"chart.highlight.stroke":"rgba(0,0,0,0)","chart.highlight.fill":"rgba(255,255,255,0.7)","chart.annotatable":!1,"chart.annotate.color":"black","chart.zoom.factor":1.5,"chart.zoom.fade.in":!0,"chart.zoom.fade.out":!0,"chart.zoom.hdir":"right","chart.zoom.vdir":"down","chart.zoom.frames":25,"chart.zoom.delay":16.666,"chart.zoom.shadow":!0,"chart.zoom.background":!0,"chart.zoom.action":"zoom","chart.resizable":!1,"chart.resize.handle.adjust":[0,0],"chart.resize.handle.background":null,"chart.adjustable":!1,"chart.ymax":null,"chart.ymin":0,"chart.scale.decimals":null,"chart.scale.point":".","chart.scale.thousand":",","chart.variant":"stacked","chart.exploded":0,"chart.events.mousemove":null,"chart.events.click":null,"chart.animation.roundrobin.factor":1,"chart.animation.roundrobin.radius":!0,"chart.animation.grow.multiplier":1},r=RGraph.array_linearize(this.data),i=0;i0&&this.Get("chart.key").length>=3&&(this.centerx=this.centerx-this.Get("chart.gutter.right")+5),typeof this.Get("chart.centerx")=="number"&&(this.centerx=this.Get("chart.centerx")),typeof this.Get("chart.centery")=="number"&&(this.centery=this.Get("chart.centery")),typeof this.Get("chart.radius")=="number"&&(this.radius=this.Get("chart.radius")),this.colorsParsed||(this.parseColors(),this.colorsParsed=!0),this.DrawBackground(),this.DrawRose(),this.DrawLabels(),this.Get("chart.contextmenu")&&RGraph.ShowContext(this),this.Get("chart.resizable")&&RGraph.AllowResizing(this),this.Get("chart.adjustable")&&RGraph.AllowAdjusting(this),RGraph.InstallEventListeners(this),RGraph.FireCustomEvent(this,"ondraw")},RGraph.Rose.prototype.DrawBackground=function(){var t,n;if(this.context.lineWidth=1,this.properties["chart.background.grid"]){for(typeof this.properties["chart.background.grid.count"]=="number"&&(this.properties["chart.background.grid.size"]=this.radius/this.properties["chart.background.grid.count"]),this.context.beginPath(),this.context.strokeStyle=this.properties["chart.background.grid.color"],n=this.properties["chart.background.grid.size"];n<=this.radius;n+=this.properties["chart.background.grid.size"])this.context.arc(this.centerx,this.centery,n,0,TWOPI,!1);if(this.context.stroke(),this.context.beginPath(),typeof this.properties["chart.background.grid.spokes"]=="number")for(t=360/this.properties["chart.background.grid.spokes"],n=t;n<=360;n+=t)this.context.arc(this.centerx,this.centery,this.radius,n/(180/PI)-HALFPI,(n+.0001)/(180/PI)-HALFPI,0),this.context.lineTo(this.centerx,this.centery);else for(n=15;n<=360;n+=15)this.context.arc(this.centerx,this.centery,this.radius,n/(180/PI)-HALFPI,(n+.0001)/(180/PI)-HALFPI,!1),this.context.lineTo(this.centerx,this.centery);this.context.stroke()}if(this.Get("chart.background.axes")){for(this.context.beginPath(),this.context.strokeStyle=this.Get("chart.background.axes.color"),this.context.moveTo(this.centerx-this.radius,Math.round(this.centery)),this.context.lineTo(this.centerx+this.radius,Math.round(this.centery)),this.context.moveTo(Math.round(this.centerx-this.radius),this.centery-5),this.context.lineTo(Math.round(this.centerx-this.radius),this.centery+5),this.context.moveTo(Math.round(this.centerx+this.radius),this.centery-5),this.context.lineTo(Math.round(this.centerx+this.radius),this.centery+5),n=this.centerx-this.radius;n-1&&(RGraph.Text(i,t,n,this.centerx,this.centery-u*.2,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u*.4,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u*.6,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u*.8,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.indexOf("s")>-1&&(RGraph.Text(i,t,n,this.centerx,this.centery+u*.2,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u*.4,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u*.6,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u*.8,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.indexOf("e")>-1&&(RGraph.Text(i,t,n,this.centerx+u*.2,this.centery,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u*.4,this.centery,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u*.6,this.centery,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u*.8,this.centery,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u,this.centery,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.indexOf("w")>-1&&(RGraph.Text(i,t,n,this.centerx-u*.2,this.centery,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u*.4,this.centery,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u*.6,this.centery,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u*.8,this.centery,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u,this.centery,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.length>0&&RGraph.Text(i,t,n,this.centerx,this.centery,typeof this.Get("chart.ymin")=="number"?RGraph.number_format(this,Number(this.Get("chart.ymin")).toFixed(this.Get("chart.scale.decimals")),f,e):"0","center","center",!0,!1,r)},RGraph.Rose.prototype.DrawCircularLabels=function(n,t,i,r,u){for(var s=this.Get("chart.variant"),c=this.Get("chart.labels.position"),u=u+5+this.Get("chart.labels.offset"),e,o,h,f=0;fthis.centerx?"left":o==this.centerx?"center":"right",RGraph.Text(n,i,r,o,h,String(t[f]),"center",halign)},RGraph.Rose.prototype.getShape=RGraph.Rose.prototype.getSegment=function(n){var t,e;RGraph.FixEventObject(n);var a=this.canvas,c=this.context,i=this.angles;for(t=0;t0?this.context.arc(n.x,n.y,n["radius.start"],n["angle.end"],n["angle.start"],!0):this.context.lineTo(n.x,n.y),this.context.closePath(),this.context.stroke(),this.context.fill())},RGraph.Rose.prototype.getObjectByXY=function(n){var t=RGraph.getMouseXY(n),i=RGraph.getHypLength(this.centerx,this.centery,t[0],t[1]);if(t[0]>this.centerx-this.radius&&t[0]this.centery-this.radius&&t[1]document.body.offsetWidth-10?(r.style.left=s[0]+c+Math.cos(o)*e-h*.9+"px",r.style.top=s[1]+l+Math.sin(o)*e-a-5+"px",f.style.left=h*.9-8.5+"px"):(r.style.left=s[0]+c+Math.cos(o)*e-h/2+"px",r.style.top=s[1]+l+Math.sin(o)*e-a-5+"px",f.style.left=h*.5-8.5+"px")},RGraph.Rose.prototype.getRadius=function(n){if(n<0||n>this.max)return null;return n/this.max*this.radius},RGraph.Rose.prototype.parseColors=function(){for(var n=0;n