RGraph=window.RGraph||{isRGraph:true};RGraph.Odometer=function(conf) {if(typeof conf==='object'&&typeof conf.min==='number'&&typeof conf.max==='number'&&typeof conf.value!=='undefined'&&typeof conf.id==='string'){var id=conf.id var canvas=document.getElementById(id);var min=conf.min;var max=conf.max;var value=conf.value;var parseConfObjectForOptions=true;}else{var id=conf;var canvas=document.getElementById(id);var min=arguments[1];var max=arguments[2];var value=arguments[3];} this.id=id;this.canvas=canvas;this.context=this.canvas.getContext?this.canvas.getContext("2d",{alpha:(typeof id==='object'&&id.alpha===false)?false:true}):null;this.canvas.__object__=this;this.type='odo';this.isRGraph=true;this.min=min;this.max=max;this.value=RGraph.stringsToNumbers(value);this.currentValue=null;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.properties={'chart.background.border':'black','chart.background.color':'#eee','chart.background.lines.color':'#ddd','chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.value.text':false,'chart.value.text.decimals':0,'chart.needle.color':'black','chart.needle.width':2,'chart.needle.head':true,'chart.needle.tail':true,'chart.needle.type':'pointer','chart.needle.extra':[],'chart.needle.triangle.border':'#aaa','chart.text.size':12,'chart.text.color':'black','chart.text.font':'Arial','chart.green.max':max*0.75,'chart.red.min':max*0.9,'chart.green.color':'Gradient(white:#0c0)','chart.yellow.color':'Gradient(white:#ff0)','chart.red.color':'Gradient(white:#f00)','chart.label.area':35,'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.font':null,'chart.title.bold':true,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.contextmenu':null,'chart.linewidth':1,'chart.shadow.inner':false,'chart.shadow.inner.color':'black','chart.shadow.inner.offsetx':3,'chart.shadow.inner.offsety':3,'chart.shadow.inner.blur':6,'chart.shadow.outer':false,'chart.shadow.outer.color':'black','chart.shadow.outer.offsetx':3,'chart.shadow.outer.offsety':3,'chart.shadow.outer.blur':6,'chart.annotatable':false,'chart.annotate.color':'black','chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.zoom.factor':1.5,'chart.zoom.fade.in':true,'chart.zoom.fade.out':true,'chart.zoom.hdir':'right','chart.zoom.vdir':'down','chart.zoom.frames':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.units.pre':'','chart.units.post':'','chart.border':false,'chart.border.color1':'#BEBCB0','chart.border.color2':'#F0EFEA','chart.border.color3':'#BEBCB0','chart.tickmarks':true,'chart.tickmarks.highlighted':false,'chart.tickmarks.big.color':'#999','chart.zerostart':false,'chart.labels':null,'chart.units.pre':'','chart.units.post':'','chart.value.units.pre':'','chart.value.units.post':'','chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.shadow':false,'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':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.halign':'right','chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.text.size':10,'chart.key.colors':null,'chart.key.text.color':'black','chart.adjustable':false} if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;} var RG=RGraph,ca=this.canvas,co=ca.getContext('2d'),prop=this.properties,pa=RG.Path,pa2=RG.path2,win=window,doc=document,ma=Math if(RG.Effects&&typeof RG.Effects.decorate==='function'){RG.Effects.decorate(this);} this.set=this.Set=function(name,value) {var value=arguments[1]||null;if(arguments.length===1&&typeof name==='object'){RG.parseObjectStyleConfig(this,name);return this;} if(name.substr(0,6)!='chart.'){name='chart.'+name;} name=name.replace(/([A-Z])/g,function(str) {return'.'+String(RegExp.$1).toLowerCase();});if(name=='chart.needle.style'){alert('[RGRAPH] The RGraph property chart.needle.style has changed to chart.needle.color');} if(name=='chart.needle.thickness'){name='chart.needle.width';} if(name=='chart.value'){this.value=value;return;} prop[name]=value;return this;};this.get=this.Get=function(name) {if(name.substr(0,6)!='chart.'){name='chart.'+name;} name=name.replace(/([A-Z])/g,function(str) {return'.'+String(RegExp.$1).toLowerCase()});if(name=='chart.value'){return this.value;} return prop[name.toLowerCase()];};this.draw=this.Draw=function() {RG.FireCustomEvent(this,'onbeforedraw');this.currentValue=this.value;if(this.value>this.max){this.value=this.max;} if(this.value0&&ca.width>ca.height)this.centerx=5+this.radius;if(typeof(prop['chart.centerx'])=='number')this.centerx=prop['chart.centerx'];if(typeof(prop['chart.centery'])=='number')this.centery=prop['chart.centery'];if(typeof(prop['chart.radius'])=='number'){this.radius=prop['chart.radius'];if(prop['chart.border']){this.radius-=25;}} if(!this.colorsParsed){this.parseColors();this.colorsParsed=true;} co.lineWidth=prop['chart.linewidth'];this.DrawBackground();this.DrawLabels();this.DrawNeedle(this.value,prop['chart.needle.color']);if(prop['chart.needle.extra'].length>0){for(var i=0;i0){var colors=[prop['chart.needle.color']];if(prop['chart.needle.extra'].length>0){for(var i=0;i=this.centerx&&mouseXY[1]<=this.centery){angle-=RG.TWOPI;} var value=((angle/RG.TWOPI)*(this.max-this.min))+this.min;return value;};this.getObjectByXY=function(e) {var mouseXY=RG.getMouseXY(e);var radius=RG.getHypLength(this.centerx,this.centery,mouseXY[0],mouseXY[1]);if(mouseXY[0]>(this.centerx-this.radius)&&mouseXY[0]<(this.centerx+this.radius)&&mouseXY[1]>(this.centery-this.radius)&&mouseXY[1]<(this.centery+this.radius)&&radius<=this.radius){return this;}};this.adjusting_mousemove=this.Adjusting_mousemove=function(e) {if(prop['chart.adjustable']&&RG.Registry.Get('chart.adjusting')&&RG.Registry.Get('chart.adjusting').uid==this.uid){this.value=this.getValue(e);RG.clear(ca);RG.redrawCanvas(ca);RG.fireCustomEvent(this,'onadjust');}};this.getAngle=function(value) {if(value>this.max||value