gauge2.moz_wev8.js 44.1 KB
function BiSvgComponent()
{if(_biInPrototype)return;BiComponent.call(this);}
_p=_biExtend(BiSvgComponent,BiComponent,"BiSvgComponent");_p._tagName="svg";_p._create=function(oDocument){this._document=oDocument||document;var el=this._element=this._document.createElementNS("http://www.w3.org/2000/svg",this._tagName);el._biComponent=this;this._setHtmlProperties();this._setCssProperties();if(BiBrowserCheck.ie){el.onscroll=BiComponent.__oninlineevent;}
else{this._setHtmlAttributes();el.onscroll=el.onfocus=BiComponent.__oninlineevent;}};_p._setHtmlProperties=function(){var el=this._element;var hp=this._htmlProperties;for(var p in hp){if(p.indexOf("xlink:")==0)
this._element.setAttributeNS("http://www.w3.org/1999/xlink",p.split(':')[1],hp[p]);else el.setAttribute(p,hp[p]);}};_p.setHtmlProperty=function(sProp,oValue){this._htmlProperties[sProp]=oValue;if(this._created){if(sProp.indexOf("xlink:")==0)
this._element.setAttributeNS("http://www.w3.org/1999/xlink",sProp.split(':')[1]);else this._element.setAttribute(sProp,oValue);}};_p.setViewBox=function(minX,minY,w,h){this.setHtmlProperty("viewBox",""+minX+" "+minY+" "+w+" "+h);};_p.calculateFlippedY=function(n)
{return this._calcConstant-n;}
_p.setLocation=function(left,top){this.setHtmlProperty("x",left);this.setHtmlProperty("y",top);};_p.setLeft=function(left){this.setHtmlProperty("x",left);};_p.setTop=function(top){this.setHtmlProperty("y",top);};_p.setSize=function(w,h){this.setWidth(w);this.setHeight(h);};_p.setWidth=function(w){this._width=w;this.setHtmlProperty("width",w);};_p.setHeight=function(h){this._height=h;this.setHtmlProperty("height",h);};_p.getWidth=function(){return this._width;};_p.getHeight=function(h){return this._height;};_p.createSvgElement=function(name)
{return this._document.createElementNS("http://www.w3.org/2000/svg",name);};BiSvgComponent.newSvgComponent=function(name)
{var c=new BiSvgComponent;c._tagName=name||"svg";return c;};function BiGauge2(){if(_biInPrototype)return;BiComponent.call(this);this._gauge2Group=new BiGauge2Group;BiComponent.prototype.add.call(this,this._gauge2Group);this.setCoordWidth(1000);this.setCoordHeight(1000);};_p=_biExtend(BiGauge2,BiComponent,"BiGauge2");BiGauge2.prototype.getCoordWidth=function(){return this._coordWidth;};BiGauge2.prototype.setCoordWidth=function(v){this._coordWidth=v;};BiGauge2.prototype.getCoordHeight=function(){return this._coordHeight;};BiGauge2.prototype.setCoordHeight=function(v){this._coordHeight=v;};BiGauge2.prototype.getPreserveAspectRatio=function(){return this._preserveAspectRatio;};BiGauge2.prototype.setPreserveAspectRatio=function(v){this._preserveAspectRatio=v;};_p.add=function(oChild){oChild._gaugeComponent=this;this._gauge2Group.add(oChild);};_p.layoutAllChildren=function(){this._gauge2Group.setSize(this.getWidth(),this.getHeight());this._gauge2Group.setViewBox(0,0,this.getCoordWidth(),this.getCoordHeight());BiComponent.prototype.layoutAllChildren.call(this);};_p.setPreserveAspectRatio=function(sValue){this._gauge2Group.setHtmlProperty("preserveAspectRatio",sValue=="yes"?"":"none");};function BiGauge2Group(){if(_biInPrototype)return;BiSvgComponent.call(this);this.setHtmlProperty("viewBox","0 0 1000 1000");this.setHtmlProperty("preserveAspectRatio","none");}
_p=_biExtend(BiGauge2Group,BiSvgComponent,"BiGauge2Group");_p.add=function(oChild){BiSvgComponent.prototype.add.call(this,oChild);};_p.getClientWidth=function(){return this._parent.getClientWidth();};_p.getClientHeight=function(){return this._parent.getClientHeight();};function BiGauge2Component(){if(_biInPrototype)return;BiSvgComponent.call(this);}
_p=_biExtend(BiGauge2Component,BiSvgComponent,"BiGauge2Component");BiGauge2Component.prototype.getFiller=function(){return this._filler;};BiGauge2Component.prototype.setFiller=function(v){this._filler=v;};BiGauge2Component.prototype.getCenterX=function(){return this._centerX;};BiGauge2Component.prototype.setCenterX=function(v){this._centerX=v;};BiGauge2Component.prototype.getCenterY=function(){return this._centerY;};BiGauge2Component.prototype.setCenterY=function(v){this._centerY=v;};_p._create=function(oDocument){BiSvgComponent.prototype._create.call(this,oDocument);if(this._stroke){BiTimer.callOnce(function(){if(!this._disposed)
this.setHtmlProperty("stroke",this._stroke);},0,this);}}
_p.add=function(oChild){BiSvgComponent.prototype.add.call(this,oChild);if(this._filler)
this._filler.applyFiller(this);};_p.setFiller=function(oFiller){var oldFiller=this._filler;this._filler=oFiller;if(this._parent)
oFiller.applyFiller(this);BiTimer.callOnce(function(){if(oldFiller)
oldFiller.dispose();});};_p.setWidth=function(nWidth){this._width=nWidth;this.setHtmlProperty("width",nWidth);this.setCenterX(this._centerX);};_p.setHeight=function(nHeight){this._height=nHeight;this.setHtmlProperty("height",nHeight);this.setCenterY(this._centerY);};_p.setCenterX=function(nCenterX){this._centerX=nCenterX;this.setLeft(nCenterX-(this._width/2));};_p.setCenterY=function(nCenterY){this._centerY=nCenterY;this.setTop(nCenterY-(this._height/2));};_p.setPosition=function(cX,cY){this.setCenterY(cY);this.setCenterX(cX);};_p.setSize=function(w,h){this.setWidth(w);this.setHeight(h);};BiGauge2Component.prototype.getStroke=function(){return this._stroke;};_p.setStroke=function(sStroke){this._stroke=sStroke;if(this._created){this.setHtmlProperty("stroke",sStroke);}};BiGauge2Component.prototype.getStrokeWidth=function(){return this._strokeWidth;};_p.setStrokeWidth=function(nStrokeWidth){this._strokeWidth=nStrokeWidth;this.setHtmlProperty("stroke-width",nStrokeWidth);};_p.layoutComponent=function(){if(this._filler)
this._filler.applyFiller(this);BiSvgComponent.prototype.layoutComponent.call(this);};function BiAbstractGauge2Border(sStroke){if(_biInPrototype)return;BiGauge2Component.call(this);if(sStroke)this.setStroke(sStroke);if(BiBrowserCheck.moz)this.setStrokeWidth(0);};_p=_biExtend(BiAbstractGauge2Border,BiGauge2Component,"BiAbstractGauge2Border");function BiGauge2ArcBorder(){if(_biInPrototype)return;BiAbstractGauge2Border.call(this);}
_p=_biExtend(BiGauge2ArcBorder,BiAbstractGauge2Border,"BiGauge2ArcBorder");_p._tagName="path";BiGauge2ArcBorder.prototype.getStartAngle=function(){return this._startAngle;};BiGauge2ArcBorder.prototype.setStartAngle=function(v){this._startAngle=v;};BiGauge2ArcBorder.prototype.getEndAngle=function(){return this._endAngle;};BiGauge2ArcBorder.prototype.setEndAngle=function(v){this._endAngle=v;};_p.layoutComponent=function(){BiAbstractGauge2Border.prototype.layoutComponent.call(this);var w=this.getWidth()/2;var h=this.getHeight()/2;var a0=this._startAngle/180*Math.PI;var a1=this._endAngle/180*Math.PI;var ox=this.getCenterX();var oy=this.getCenterY();var p0=Math.round(Math.sin(a0)*w+ox)+" "+Math.round(-Math.cos(a0)*h+oy);var p1=Math.round(Math.sin(a1)*w+ox)+" "+Math.round(-Math.cos(a1)*h+oy);var la=Math.abs(this._startAngle-this._endAngle)>180?" 1":" 0";var d=["M",p0," A",w,",",h," 0",la," 1 ",p1," L",p0].join("");this.setHtmlProperty("d",d);}
function BiGauge2CircularBorder(){if(_biInPrototype)return;BiAbstractGauge2Border.call(this);}
_p=_biExtend(BiGauge2CircularBorder,BiAbstractGauge2Border,"BiGauge2CircularBorder");_p._tagName="ellipse";_p.setSize=function(nWidth,nHeight){this._width=nWidth;this.setHtmlProperty("cx",nWidth/2);this.setHtmlProperty("cy",nHeight/2);this._height=nHeight;this.setHtmlProperty("rx",nWidth/2-10);this.setHtmlProperty("ry",nHeight/2-10);};_p.setWidth=function(nWidth){this._width=nWidth;this.setHtmlProperty("rx",nWidth/2-10);};_p.setHeight=function(nHeight){this._height=nHeight;this.setHtmlProperty("ry",nHeight/2-10);};_p.setCenterX=function(nCenterX){this._centerX=nCenterX;this.setHtmlProperty("cx",nCenterX);};_p.setCenterY=function(nCenterY){this._centerY=nCenterY;this.setHtmlProperty("cy",nCenterY);};function BiGauge2RectangularBorder(nArcSize){if(_biInPrototype)return;BiAbstractGauge2Border.call(this);this.setArcSize(0);}
_p=_biExtend(BiGauge2RectangularBorder,BiAbstractGauge2Border,"BiGauge2RectangularBorder");_p._tagName="rect";BiGauge2RectangularBorder.prototype.getArcSize=function(){return this._arcSize;};BiGauge2RectangularBorder.prototype.setArcSize=function(v){this._arcSize=v;};_p.setArcSize=function(n){n=parseInt(n);this._arcSize=n;var w=this.getWidth();var h=this.getHeight();var min=Math.min(w,h);n=min?min*n/100:n;this.setHtmlProperty("rx",n);this.setHtmlProperty("ry",n);}
BiGauge2RectangularBorder.prototype.getAngle=function(){return this._angle;};BiGauge2RectangularBorder.prototype.setAngle=function(v){this._angle=v;};_p.setAngle=function(n){this._angle=n;this.setHtmlProperty("transform","rotate("+n+" "+(this.getWidth()/2)+" "+(this.getHeight()/2));}
_p.layoutComponent=function(){BiAbstractGauge2Border.prototype.layoutComponent.call(this);if(this._arcSize)
this.setArcSize(this._arcSize);}
function BiGauge2ImageBorder(sHref){if(_biInPrototype)return;BiAbstractGauge2Border.call(this);this.setHtmlProperty("preserveAspectRatio","none");}
_p=_biExtend(BiGauge2ImageBorder,BiAbstractGauge2Border,"BiGauge2ImageBorder");_p._tagName="image";BiGauge2ImageBorder.prototype.getUri=function(){return this._uri;};_p.setUri=function(oUri){if(oUri!=null&&!(oUri instanceof BiUri)){oUri=new BiUri(application.getAdfPath(),oUri);}
var sUri=String(oUri);if(String(this._uri)!=sUri){this._uri=oUri;this.setHtmlProperty("xlink:href",sUri);}}
function BiAbstractGauge2Filler(){if(_biInPrototype)return;BiGauge2Component.call(this);};_p=_biExtend(BiAbstractGauge2Filler,BiGauge2Component,"BiAbstractGauge2Filler");_p._tagName="";_p.applyFiller=function(oGroupChild){};function BiGauge2PlainColorFiller(sColor){if(_biInPrototype)return;BiAbstractGauge2Filler.call(this);if(sColor)
this.setColor(sColor);};_p=_biExtend(BiGauge2PlainColorFiller,BiAbstractGauge2Filler,"BiGauge2PlainColorFiller");_p._tagName="";BiGauge2PlainColorFiller.prototype.getColor=function(){return this._color;};BiGauge2PlainColorFiller.prototype.setColor=function(v){this._color=v;};_p.applyFiller=function(oGroupChild){oGroupChild.setHtmlProperty("fill",(this._color?this._color:"none"));};function BiAbstractGauge2GradientFiller(){if(_biInPrototype)return;BiAbstractGauge2Filler.call(this);if(BiBrowserCheck.moz){this._stop1=BiSvgComponent.newSvgComponent("stop");this._stop2=BiSvgComponent.newSvgComponent("stop");this._stop1.setHtmlProperty("offset","0%");this._stop2.setHtmlProperty("offset","100%");this.add(this._stop1);this.add(this._stop2);}};_p=_biExtend(BiAbstractGauge2GradientFiller,BiAbstractGauge2Filler,"BiAbstractGauge2GradientFiller");_p._color1="black";_p._color2="white";_p._opacity1=1;_p._opacity2=1;_p._xpos=50;_p._ypos=50;BiAbstractGauge2GradientFiller.prototype.getColor1=function(){return this._color1;};BiAbstractGauge2GradientFiller.prototype.setColor1=function(v){this._color1=v;};BiAbstractGauge2GradientFiller.prototype.getColor2=function(){return this._color2;};BiAbstractGauge2GradientFiller.prototype.setColor2=function(v){this._color2=v;};BiAbstractGauge2GradientFiller.prototype.getOpacity1=function(){return this._opacity1;};BiAbstractGauge2GradientFiller.prototype.setOpacity1=function(v){this._opacity1=v;};BiAbstractGauge2GradientFiller.prototype.getOpacity2=function(){return this._opacity2;};BiAbstractGauge2GradientFiller.prototype.setOpacity2=function(v){this._opacity2=v;};BiAbstractGauge2GradientFiller.prototype.getXpos=function(){return this._xpos;};BiAbstractGauge2GradientFiller.prototype.setXpos=function(v){this._xpos=v;};BiAbstractGauge2GradientFiller.prototype.getYpos=function(){return this._ypos;};BiAbstractGauge2GradientFiller.prototype.setYpos=function(v){this._ypos=v;};function BiGauge2RadialGradientFiller(){if(_biInPrototype)return;BiAbstractGauge2GradientFiller.call(this);}
_p=_biExtend(BiGauge2RadialGradientFiller,BiAbstractGauge2GradientFiller,"BiGauge2RadialGradientFiller");_p._tagName="radialGradient";_p._used=false;_p.setColor1=function(sCol){this._color1=sCol;this._stop1.setHtmlProperty("stop-color",sCol);}
_p.setColor2=function(sCol){this._color2=sCol;this._stop2.setHtmlProperty("stop-color",sCol);}
_p.setOpacity1=function(n){this._opacity1=n;this._stop1.setHtmlProperty("opacity",n);}
_p.setOpacity2=function(n){this._opacity2=n;this._stop2.setHtmlProperty("opacity2",n);}
_p.setXpos=function(n){this._xpos=n;this.setHtmlProperty("fx",n+"%");}
_p.setYpos=function(n){this._yoos=n;this.setHtmlProperty("fy",n+"%");}
_p.applyFiller=function(oGroupChild){if(!this._used&&oGroupChild._parent){this._stop2.setHtmlProperty("stop-color",this.getColor2());this._stop1.setHtmlProperty("stop-color",this.getColor1());this._stop2.setHtmlProperty("stop-opacity",this.getOpacity2());this._stop1.setHtmlProperty("stop-opacity",this.getOpacity1());this.setHtmlProperty("fx",this.getXpos()+"%");this.setHtmlProperty("fy",this.getYpos()+"%");oGroupChild._parent.add(this);oGroupChild.setHtmlProperty("fill","url(#"+this.getHtmlProperty("id")+")");this._used=true;}};function BiGauge2RingGradientFiller(){if(_biInPrototype)return;BiAbstractGauge2GradientFiller.call(this);}
BiAbstractGauge2GradientFiller.prototype.getHighlightCenter=function(){return this._highlightCenter;};BiAbstractGauge2GradientFiller.prototype.setHighlightCenter=function(v){this._highlightCenter=v;};_p._highLightCenter=50;BiAbstractGauge2GradientFiller.prototype.getThickness=function(){return this._thickness;};BiAbstractGauge2GradientFiller.prototype.setThickness=function(v){this._thickness=v;};_p._thickness=10;_p=_biExtend(BiGauge2RingGradientFiller,BiAbstractGauge2GradientFiller,"BiGauge2RingGradientFiller");_p._tagName="radialGradient";_p._used=false;_p.setColor1=function(sCol){this._color1=sCol;this._stop1.setHtmlProperty("stop-color",sCol);}
_p.setColor2=function(sCol){this._color2=sCol;this._stop2.setHtmlProperty("stop-color",sCol);}
_p.setOpacity1=function(n){this._opacity1=n;this._stop1.setHtmlProperty("opacity",n);}
_p.setOpacity2=function(n){this._opacity2=n;this._stop2.setHtmlProperty("opacity2",n);}
_p.setXpos=function(n){this._xpos=n;if(this._created)
this._calculateOffsets();}
_p.setYpos=function(n){this._ypos=n;if(this._created)
this._calculateOffsets();}
_p.setThickness=function(n){this._thickness=n;if(this._created)
this._calculateOffsets();}
_p.setHighlightCenter=function(n){this._highlightCenter=n;if(this._created)
this._calculateOffsets();}
_p._calculateOffsets=function(){if(this._stop3){this._stop3.dispose();delete this._stop3;}
var x=this.getXpos()-50;var y=this.getYpos()-50;var r=50+Math.sqrt(x*x+y*y);this.setHtmlProperty("cx",this.getXpos()+"%");this.setHtmlProperty("cy",this.getYpos()+"%");this.setHtmlProperty("r",r+"%");var p=r/50;var o1=(100-this._thickness*2);var o2=(100-this._thickness*2*(100-this._highlightCenter)/100);if(o1!=100)o1/=p;if(o2!=100)o2/=p;this._stop1.setHtmlProperty("offset",o1+"%");this._stop2.setHtmlProperty("offset",o2+"%");if(o2!=100){this._stop3=BiSvgComponent.newSvgComponent("stop");this.add(this._stop3);this._stop3.setHtmlProperty("stop-color",this.getColor1());this._stop3.setHtmlProperty("stop-opacity",this.getOpacity1());this._stop3.setHtmlProperty("offset","100%");}}
_p.applyFiller=function(oGroupChild){if(!this._used&&oGroupChild._parent){this._stop1.setHtmlProperty("stop-color",this.getColor1());this._stop2.setHtmlProperty("stop-color",this.getColor2());this._stop1.setHtmlProperty("stop-opacity",this.getOpacity1());this._stop2.setHtmlProperty("stop-opacity",this.getOpacity2());var x=this.getXpos()-50;var y=this.getYpos()-50;var r=50+Math.sqrt(x*x+y*y);this.setHtmlProperty("cx",this.getXpos()+"%");this.setHtmlProperty("cy",this.getYpos()+"%");this.setHtmlProperty("r",r+"%");this._calculateOffsets();oGroupChild._parent.add(this);oGroupChild.setHtmlProperty("fill","url(#"+this.getHtmlProperty("id")+")");this._used=true;}};function BiGauge2LinearGradientFiller(){if(_biInPrototype)return;BiAbstractGauge2GradientFiller.call(this);}
_p=_biExtend(BiGauge2LinearGradientFiller,BiAbstractGauge2GradientFiller,"BiGauge2LinearGradientFiller");_p._angle=0;BiGauge2LinearGradientFiller.prototype.getAngle=function(){return this._angle;};BiGauge2LinearGradientFiller.prototype.setAngle=function(v){this._angle=v;};_p._tagName="linearGradient";_p._used=false;_p.setColor1=function(sCol){this._color1=sCol;this._stop1.setHtmlProperty("stop-color",sCol);}
_p.setColor2=function(sCol){this._color2=sCol;this._stop2.setHtmlProperty("stop-color",sCol);}
_p.setOpacity1=function(n){this._opacity1=n;this._stop1.setHtmlProperty("opacity",n);}
_p.setOpacity2=function(n){this._opacity2=n;this._stop2.setHtmlProperty("opacity2",n);}
_p.setAngle=function(n){this._angle=n;var a=(-n+90);this.setHtmlProperty("gradientTransform","translate(.5,.5) rotate("+a+") translate(-.5,-.5)");}
_p.applyFiller=function(oGroupChild){if(!this._used&&oGroupChild._parent){this._stop1.setHtmlProperty("stop-color",this.getColor1());this._stop2.setHtmlProperty("stop-color",this.getColor2());this._stop1.setHtmlProperty("stop-opacity",this.getOpacity1());this._stop2.setHtmlProperty("stop-opacity",this.getOpacity2());var a=(-this.getAngle()+90);this.setHtmlProperty("gradientTransform","translate(.5,.5) rotate("+a+") translate(-.5,-.5)");oGroupChild._parent.add(this);oGroupChild.setHtmlProperty("fill","url(#"+this.getHtmlProperty("id")+")");this._used=true;}};function BiAbstractGauge2Range(){if(_biInPrototype)return;BiGauge2Component.call(this);}
_p=_biExtend(BiAbstractGauge2Range,BiGauge2Component,"BiAbstractGauge2Range");_p.setWidth=function(nWidth){this._width=nWidth;this.setHtmlProperty("width",nWidth);this.setViewBox(0,0,this._width,this._height);this.setCenterX(this._centerX);};_p.setHeight=function(nHeight){this._height=nHeight;this.setHtmlProperty("height",nHeight);this.setViewBox(0,0,this._width,this._height);this.setCenterY(this._centerY);};function BiGauge2RadialRange(){if(_biInPrototype)return;BiAbstractGauge2Range.call(this);}
_p=_biExtend(BiGauge2RadialRange,BiAbstractGauge2Range,"BiGauge2RadialRange");BiGauge2RadialRange.prototype.getStartAngle=function(){return this._startAngle;};BiGauge2RadialRange.prototype.setStartAngle=function(v){this._startAngle=v;};BiGauge2RadialRange.prototype.getEndAngle=function(){return this._endAngle;};BiGauge2RadialRange.prototype.setEndAngle=function(v){this._endAngle=v;};_p.add=function(oChild){if(oChild instanceof BiGauge2RadialTicks||oChild instanceof BiGauge2RadialScale){oChild.setStartAngle(this._startAngle);oChild.setEndAngle(this._endAngle);}
if(oChild._tagName=="svg"){oChild.setViewBox(0,0,this.getWidth(),this.getHeight());oChild.setSize(this.getWidth(),this.getHeight());}
BiAbstractGauge2Range.prototype.add.call(this,oChild);};_p.layoutAllChildren=function(){var cs=this._children;var l=cs.length;for(var i=0;i<l;i++){var child=cs[i];if(!(child instanceof BiGauge2Label))
child.setPosition(this.getWidth()/2,this.getHeight()/2);if(child instanceof BiAbstractGauge2Border)
child.setSize(this.getWidth(),this.getHeight());child.layoutComponent();}
this._invalidLayout=false;};function BiGauge2LinearRange(){if(_biInPrototype)return;BiAbstractGauge2Range.call(this);}
_p=_biExtend(BiGauge2LinearRange,BiAbstractGauge2Range,"BiGauge2LinearRange");BiGauge2LinearRange.prototype.getAngle=function(){return this._angle;};BiGauge2LinearRange.prototype.setAngle=function(v){this._angle=v;};_p.setAngle=function(n){this._angle=n;this.setHtmlProperty("transform","rotate("+n+" "+(this.getWidth()/2)+" "+(this.getHeight()/2));}
_p.add=function(oChild){if(oChild._tagName=="svg"){oChild.setViewBox(0,0,this.getWidth(),this.getHeight());oChild.setSize(this.getWidth(),this.getHeight());}
if(oChild instanceof BiAbstractGauge2Border&&!oChild.getWidth()&&!oChild.getHeight()){oChild.setSize(this.getWidth(),this.getHeight());}
BiAbstractGauge2Range.prototype.add.call(this,oChild);};_p.layoutAllChildren=function(){var cs=this._children;var l=cs.length;for(var i=0;i<l;i++){if(!(cs[i]instanceof BiGauge2Label))
cs[i].setPosition(this.getWidth()/2,this.getHeight()/2);cs[i].layoutComponent();}
this._invalidLayout=false;};function BiAbstractGauge2Ticks(){if(_biInPrototype)return;BiGauge2Component.call(this);this._ticks=[];};_p=_biExtend(BiAbstractGauge2Ticks,BiGauge2Component,"BiAbstractGauge2Ticks");_p._tagName="g";BiAbstractGauge2Ticks.prototype.getTickWidth=function(){return this._tickWidth;};BiAbstractGauge2Ticks.prototype.getTickLength=function(){return this._tickLength;};BiAbstractGauge2Ticks.prototype.setTickLength=function(v){this._tickLength=v;};BiAbstractGauge2Ticks.prototype.getTickCount=function(){return this._tickCount;};BiAbstractGauge2Ticks.prototype.setTickCount=function(v){this._tickCount=v;};BiAbstractGauge2Ticks.prototype.getColor=function(){return this._color;};_p.setTickWidth=function(nTickWidth){this._tickWidth=nTickWidth;this.setHtmlProperty("stroke-width",nTickWidth);};_p.setColor=function(sColor){this._color=sColor;this.setHtmlProperty("stroke",sColor);};BiAbstractGauge2Ticks.prototype.getColors=function(){return this._colors;};_p.setColors=function(o){if(typeof o=="string"){o=o.split(",");var l=o.length;for(var i=0;i<l;i++){o[i]=i%2?parseInt(o[i]):o[i].trim();}}
this._colors=o;}
BiAbstractGauge2Ticks.prototype.getColorFunction=function(){return this._colorFunction;};_p._colorFunction=_p.getColor;_p.setColorFunction=function(f){if(typeof f=="string")
f=new Function("v",f);this._colorFunction=f||_p.getColor;}
_p._calculateTicks=function(){return"";}
_p.layoutComponent=function(){if(!this._ticksCreated){this._createTicks();if(this._colors instanceof Array){var cs=this._colors;var l=this._ticks.length;var ai=0;var j=cs[1]||Number.MAX_VALUE;for(var i=0;i<l;i++,j--){if(j==0){ai+=2;j=cs[ai+1]||Number.MAX_VALUE;}
if(cs[ai]){this._ticks[i].setAttribute("fill",cs[ai]);this._ticks[i].setAttribute("stroke",cs[ai]);}
else break;}}
this._ticksCreated=true;}
BiGauge2Component.prototype.layoutComponent.call(this);};_p.dispose=function(){BiGauge2Component.prototype.dispose.call(this);this.disposeFields("_ticks");}
function BiGauge2RadialTicks(){if(_biInPrototype)return;BiAbstractGauge2Ticks.call(this);};_p=_biExtend(BiGauge2RadialTicks,BiAbstractGauge2Ticks,"BiGauge2RadialTicks");BiGauge2RadialTicks.prototype.getStartAngle=function(){return this._startAngle;};BiGauge2RadialTicks.prototype.setStartAngle=function(v){this._startAngle=v;};BiGauge2RadialTicks.prototype.getEndAngle=function(){return this._endAngle;};BiGauge2RadialTicks.prototype.setEndAngle=function(v){this._endAngle=v;};BiGauge2RadialTicks.prototype.getRadius=function(){return this._radius;};BiGauge2RadialTicks.prototype.setRadius=function(v){this._radius=v;};_p._createTicks=function(){var tl=this._tickLength;var r=this.getRadius();var r1=r-this._tickLength/2;var r2=r+this._tickLength/2;var angleStep=(Math.abs(this._endAngle-this._startAngle)/180*Math.PI)/(this._tickCount-1);var angle=this._startAngle/180*Math.PI;var endAngle=this._endAngle/180*Math.PI;var offsetX=this._parent.getWidth()/2;var offsetY=this._parent.getHeight()/2;for(var i=0;i<this._tickCount;i++,angle+=angleStep){var el=this._document.createElementNS("http://www.w3.org/2000/svg","path");var color=this.getColorFunction().call(this,i);el.setAttribute("fill",color);el.setAttribute("stroke",color);el.setAttribute("stroke-width",this._strokeWidth);var x1=r1*Math.sin(angle);var y1=r1*Math.cos(angle);var x2=r2*Math.sin(angle);var y2=r2*Math.cos(angle);x1=Math.round(offsetX+x1);y1=Math.round(offsetY-y1);x2=Math.round(offsetX+x2);y2=Math.round(offsetY-y2);el.setAttribute("d","M"+x1+","+y1+"L"+x2+","+y2);this._element.appendChild(el);this._ticks.push(el);}}
_p._calculateTicks=function(){var dStr=[];var r=this.getRadius();var r1=r-this._tickLength/2;var r2=r+this._tickLength/2;var angleStep=(Math.abs(this._endAngle-this._startAngle)/180*Math.PI)/(this._tickCount-1);var angle=this._startAngle/180*Math.PI;var endAngle=this._endAngle/180*Math.PI;while(angle<=endAngle){var x1=r1*Math.sin(angle);var y1=r1*Math.cos(angle);var x2=r2*Math.sin(angle);var y2=r2*Math.cos(angle);x1=(this._parent.getWidth()/2+x1);y1=(this._parent.getHeight()/2-y1);x2=(this._parent.getWidth()/2+x2);y2=(this._parent.getHeight()/2-y2);dStr.push("M"+x1+","+y1+" L"+x2+","+y2+" ");angle+=angleStep;}
return dStr.join("");};function BiGauge2LinearTicks(){if(_biInPrototype)return;BiAbstractGauge2Ticks.call(this);};_p=_biExtend(BiGauge2LinearTicks,BiAbstractGauge2Ticks,"BiGauge2LinearTicks");BiGauge2LinearTicks.prototype.getAngle=function(){return this._angle;};BiGauge2LinearTicks.prototype.setAngle=function(v){this._angle=v;};BiGauge2LinearTicks.prototype.getTickSpacing=function(){return this._tickSpacing;};BiGauge2LinearTicks.prototype.setTickSpacing=function(v){this._tickSpacing=v;};_p._createTicks=function(){var tl=this._tickLength;var n=this._tickCount;var r= -((n-1)/2*this._tickSpacing);if(this._angle==null)
this._angle=this._parent.getAngle();var angle=this._angle/180*Math.PI;for(var i=0;i<n;i++){var el=this._document.createElementNS("http://www.w3.org/2000/svg","path");var color=this.getColorFunction().call(this,i);el.setAttribute("fill",color);el.setAttribute("stroke",color);el.setAttribute("stroke-width",this._strokeWidth);var x=r*Math.sin(angle);var y=r*Math.cos(angle);var x1=x-tl/2*Math.cos(angle);var y1=y+tl/2*Math.sin(angle);var x2=x+tl/2*Math.cos(angle);var y2=y-tl/2*Math.sin(angle);x1=(this._parent.getWidth()/2+x1);y1=(this._parent.getHeight()/2-y1);x2=(this._parent.getWidth()/2+x2);y2=(this._parent.getHeight()/2-y2);el.setAttribute("d","M"+x1+","+y1+"L"+x2+","+y2);this._element.appendChild(el);this._ticks.push(el);r+=this._tickSpacing;}}
function BiAbstractGauge2Scale(){if(_biInPrototype)return;BiGauge2Component.call(this);};_p=_biExtend(BiAbstractGauge2Scale,BiGauge2Component,"BiAbstractGauge2Scale");_p._font=BiFont.fromString("Arial 20");_p._verticalAlign="middle";_p._preString="";_p._postString="";BiAbstractGauge2Scale.prototype.getFont=function(){return this._font;};BiAbstractGauge2Scale.prototype.setFont=function(v){this._font=v;};_p.setFont=function(o){if(!(o instanceof BiFont)){o=BiFont.fromString(""+o);}
this._font=o;};BiAbstractGauge2Scale.prototype.getForeColor=function(){return this._foreColor;};BiAbstractGauge2Scale.prototype.setForeColor=function(v){this._foreColor=v;};BiAbstractGauge2Scale.prototype.getLabelCount=function(){return this._labelCount;};BiAbstractGauge2Scale.prototype.setLabelCount=function(v){this._labelCount=v;};BiAbstractGauge2Scale.prototype.getPostString=function(){return this._postString;};BiAbstractGauge2Scale.prototype.setPostString=function(v){this._postString=v;};BiAbstractGauge2Scale.prototype.getPreString=function(){return this._preString;};BiAbstractGauge2Scale.prototype.setPreString=function(v){this._preString=v;};BiAbstractGauge2Scale.prototype.getStartValue=function(){return this._startValue;};BiAbstractGauge2Scale.prototype.setStartValue=function(v){this._startValue=v;};BiAbstractGauge2Scale.prototype.getEndValue=function(){return this._endValue;};BiAbstractGauge2Scale.prototype.setEndValue=function(v){this._endValue=v;};BiAbstractGauge2Scale.prototype.getColors=function(){return this._colors;};_p.setColors=function(o){if(typeof o=="string"){o=o.split(",");var l=o.length;for(var i=0;i<l;i++){o[i]=i%2?parseInt(o[i]):o[i].trim();}}
this._colors=o;}
BiAbstractGauge2Scale.prototype.getColorFunction=function(){return this._colorFunction;};_p._colorFunction=_p.getForeColor;_p.setColorFunction=function(f){if(typeof f=="string")
f=new Function("v",f);this._colorFunction=f||_p.getForeColor;}
BiAbstractGauge2Scale.prototype.getValueFunction=function(){return this._valueFunction;};_p._valueFunction=function(v){return v;}
_p.setValueFunction=function(f){if(typeof f=="string")
f=new Function("v",f);this._valueFunction=f||function(v){return v;};}
function BiGauge2RadialScale(){if(_biInPrototype)return;BiAbstractGauge2Scale.call(this);this._labels=[];};_p=_biExtend(BiGauge2RadialScale,BiAbstractGauge2Scale,"BiGauge2RadialScale");BiGauge2RadialScale.prototype.getStartAngle=function(){return this._startAngle;};BiGauge2RadialScale.prototype.setStartAngle=function(v){this._startAngle=v;};BiGauge2RadialScale.prototype.getEndAngle=function(){return this._endAngle;};BiGauge2RadialScale.prototype.setEndAngle=function(v){this._endAngle=v;};BiGauge2RadialScale.prototype.getRadius=function(){return this._radius;};BiGauge2RadialScale.prototype.setRadius=function(v){this._radius=v;};_p._valueToAngle=function(n){var v0=this.getStartValue();var v1=this.getEndValue();var a0=this.getStartAngle();var a1=this.getEndAngle();return v0==v1?a0:a0+(a1-a0)*(n-v0)/(v1-v0);};_p._removeLabels=function(){if(!this.getCreated())return;for(var i=0;i<this._labels.length;i++){this._element.removeChild(this._labels[i]);this._labels[i]=null;}
this._labels=[];};_p._createLabels=function(){if(!this._labelCount)
return;var labels=this._labels=[];var l=this._labelCount;var d=Math.max(1,l-1);var v0=this.getStartValue();var v1=this.getEndValue();for(var i=0;i<l;i++){var v=v0+(v1-v0)*(i/d);v=Math.round(v*1000)/1000;labels.push(this._createLabel(v));}
if(this._colors instanceof Array){var cs=this._colors;var l=labels.length;var ai=0;var j=cs[1]||Number.MAX_VALUE;for(var i=0;i<l;i++,j--){if(j==0){ai+=2;j=cs[ai+1]||Number.MAX_VALUE;}
if(cs[ai])
labels[i].setAttribute("fill",cs[ai]);else break;}}};_p._createLabel=function(nValue){var v=this._valueToAngle(nValue,this.getStartValue(),this.getEndValue(),this.getStartAngle(),this.getEndAngle());nValue=this.getValueFunction().call(this,nValue);var vr=v/180*Math.PI;var r=this.getRadius();var el=this.createSvgElement("text");var textNode=this._document.createTextNode(this._preString+nValue+this._postString);var x=r*Math.sin(vr);var y=r*Math.cos(vr);var size=this._font.getSize();x=Math.round(this.getWidth()/2+x);y=Math.round(this.getHeight()/2-y);el.setAttribute("x",x+1);el.setAttribute("y",y+10*size/30);el.setAttribute("font-family",this._font.getName());el.setAttribute("fill",this.getColorFunction().call(this,nValue));el.setAttribute("font-size",size);if(this._font.getBold())
el.setAttribute("font-weight","bold");else el.setAttribute("font-weight",200);el.setAttribute("text-anchor","middle");el.appendChild(textNode);if(this._element.hasChildNodes())
this._element.insertBefore(el,this._element.firstChild);else this._element.appendChild(el);return el;};_p.layoutComponent=function(){this._createLabels();this.layoutAllChildren();}
function BiGauge2LinearScale(){if(_biInPrototype)return;BiAbstractGauge2Scale.call(this);};_p=_biExtend(BiGauge2LinearScale,BiAbstractGauge2Scale,"BiGauge2LinearScale");BiGauge2LinearScale.prototype.getLabelSpacing=function(){return this._labelSpacing;};BiGauge2LinearScale.prototype.setLabelSpacing=function(v){this._labelSpacing=v;};BiGauge2LinearScale.prototype.getLabelPosition=function(){return this._labelPosition;};BiGauge2LinearScale.prototype.setLabelPosition=function(v){this._labelPosition=v;};BiGauge2LinearScale.prototype.getAngle=function(){return this._angle;};BiGauge2LinearScale.prototype.setAngle=function(v){this._angle=v;};_p._removeLabels=function(){if(!this.getCreated())return;for(var i=0;i<this._labels.length;i++){this._element.removeChild(this._labels[i]);this._labels[i]=null;}
this._labels=[];};_p._valueToPosition=function(nValue){var r= -((this._labelCount-1)/2*this._labelSpacing);return(2*r)-((nValue-this.getStartValue())/(this.getEndValue()-this.getStartValue())*r*2+r);}
_p._createLabels=function(){var labels=[];var step=(this.getEndValue()-this.getStartValue())/(this._labelCount-1);var v=this.getStartValue();var r= -((this._labelCount-1)/2*this._labelSpacing);if(this._angle==null)
this._angle=this._parent.getAngle();var angle=this._angle/180*Math.PI;while(v<=this.getEndValue()){v=Math.round(v*1000)/1000;labels.push(this._createLabel(v,r,angle));v+=step;r+=this._labelSpacing;}
this._labels=labels;if(this._colors instanceof Array){var cs=this._colors;var l=labels.length;var ai=0;var j=cs[1]||Number.MAX_VALUE;for(var i=0;i<l;i++,j--){if(j==0){ai+=2;j=cs[ai+1]||Number.MAX_VALUE;}
if(cs[ai]){labels[i].setAttribute("fill",cs[ai]);}
else break;}}};_p._createLabel=function(nValue,r,angle){var x=r*Math.sin(angle);var y=r*Math.cos(angle);var x1=x+this._labelPosition*Math.cos(angle);var y1=y-this._labelPosition*Math.sin(angle);x1=(this._parent.getWidth()/2+x1);y1=(this._parent.getHeight()/2-y1);var el=this.createSvgElement("text");nValue=this.getValueFunction().call(this,nValue);var textNode=this._document.createTextNode(this._preString+nValue+this._postString);var color=this.getColorFunction().call(this,nValue);el.setAttribute("fill",color);el.setAttribute("x",x1+1);el.setAttribute("y",y1+10);el.setAttribute("width",400);el.setAttribute("height",80);el.setAttribute("font-family",this._font.getName());el.setAttribute("font-size",this._font.getSize());if(this._font.getBold())
el.setAttribute("font-weight","bold");else el.setAttribute("font-weight","normal");el.setAttribute("text-anchor",(Math.abs(this._angle)>60?"middle":"end"));el.appendChild(textNode);if(this._element.hasChildNodes())
this._element.insertBefore(el,this._element.firstChild);else this._element.appendChild(el);return el;};_p.layoutComponent=function(){this._createLabels();this.layoutAllChildren();}
function BiAbstractGauge2Cap(){if(_biInPrototype)return;BiGauge2Component.call(this);if(!BiBrowserCheck.ie)
this.setStrokeWidth(0);};_p=_biExtend(BiAbstractGauge2Cap,BiGauge2Component,"BiAbstractGauge2Cap");function BiGauge2BasicCap(){if(_biInPrototype)return;BiAbstractGauge2Cap.call(this);};_p=_biExtend(BiGauge2BasicCap,BiAbstractGauge2Cap,"BiGauge2BasicCap");_p._tagName="ellipse";_p.setCenterX=function(nX){this._centerX=nX;this.setHtmlProperty("cx",nX);}
_p.setCenterY=function(nY){this._centerY=nY;this.setHtmlProperty("cy",nY);}
_p.setWidth=function(nWidth){this._width=nWidth;this.setHtmlProperty("rx",nWidth/2);};_p.setHeight=function(nHeight){this._height=nHeight;this.setHtmlProperty("ry",nHeight/2);};function BiAbstractGauge2ValueMarker(){if(_biInPrototype)return;BiGauge2Component.call(this);};_p=_biExtend(BiAbstractGauge2ValueMarker,BiGauge2Component,"BiAbstractGauge2ValueMarker");BiAbstractGauge2ValueMarker.prototype.getValue=function(){return this._value;};BiAbstractGauge2ValueMarker.prototype.setValue=function(v){this._value=v;};function BiGauge2RadialNeedle(){if(_biInPrototype)return;BiAbstractGauge2ValueMarker.call(this);};_p=_biExtend(BiGauge2RadialNeedle,BiAbstractGauge2ValueMarker,"BiGauge2RadialNeedle");_p._innerRadius=0;_p._innerWidth=10;_p._outerWidth=0;BiGauge2RadialNeedle.prototype.getOuterRadius=function(){return this._outerRadius;};BiGauge2RadialNeedle.prototype.setOuterRadius=function(v){this._outerRadius=v;};BiGauge2RadialNeedle.prototype.getInnerRadius=function(){return this._innerRadius;};BiGauge2RadialNeedle.prototype.setInnerRadius=function(v){this._innerRadius=v;};BiGauge2RadialNeedle.prototype.getInnerWidth=function(){return this._innerWidth;};BiGauge2RadialNeedle.prototype.setInnerWidth=function(v){this._innerWidth=v;};BiGauge2RadialNeedle.prototype.getOuterWidth=function(){return this._outerWidth;};BiGauge2RadialNeedle.prototype.setOuterWidth=function(v){this._outerWidth=v;};_p._tagName="polyline";_p.setValue=function(n){this._value=n;if(this.getCreated())
this._calculatePoints();};_p._calculatePoints=function(){var v=this._parent._valueToAngle(this._value);var vr=v/180*Math.PI;var r=this.getOuterRadius();var r2=this.getInnerRadius();var p1x=r*Math.sin(vr);var p1y=r*Math.cos(vr);var p2x=r2*Math.sin(vr);var p2y=r2*Math.cos(vr);var a=vr-Math.PI/2;var iw=this._innerWidth/2;var ow=this._outerWidth/2;var p3x=p2x+iw*Math.sin(a);var p3y=p2y+iw*Math.cos(a);var p4x=p1x+ow*Math.sin(a);var p4y=p1y+ow*Math.cos(a);a+=Math.PI;p1x+=ow*Math.sin(a);p1y+=ow*Math.cos(a);p2x+=iw*Math.sin(a);p2y+=iw*Math.cos(a);var w=this._parent.getWidth()/2;var h=this._parent.getHeight()/2;p1x=w+p1x;p1y=h-p1y;p2x=w+p2x;p2y=h-p2y;p3x=w+p3x;p3y=h-p3y;p4x=w+p4x;p4y=h-p4y;var pointsValue=p3x+","+p3y+" "+p4x+","+p4y+" "+p1x+","+p1y+" "+p2x+","+p2y+" "+p3x+","+p3y;this.setHtmlProperty("points",pointsValue);};_p.layoutComponent=function(){if(this._value==null){var p=this._parent;this.setValue((p.getEndValue()-p.getStartValue())/2+p.getStartValue());}else{this._calculatePoints();}
BiAbstractGauge2ValueMarker.prototype.layoutComponent.call(this);}
function BiGauge2RadialArrowNeedle(){if(_biInPrototype)return;BiAbstractGauge2ValueMarker.call(this);};_p=_biExtend(BiGauge2RadialArrowNeedle,BiGauge2RadialNeedle,"BiGauge2RadialArrowNeedle");_p._tagName="polyline";BiGauge2RadialArrowNeedle.prototype.getPointerLength=function(){return this._pointerLength;};BiGauge2RadialArrowNeedle.prototype.setPointerLength=function(v){this._pointerLength=v;};_p.setValue=function(n){this._value=n;if(this.getCreated())
this._calculatePoints();};_p._calculatePoints=function(){if(!this._ps){var wi=this._innerWidth/2;var wo=this._outerWidth/2;var ri=this.getInnerRadius();var ro=this.getOuterRadius();var l=ro-ri;var pl=this._pointerLength||l/3;var x=[-wo,-wi,wi,wo];var y=[ri,ro-pl,ro];this._ps=[[x[1],y[0]],[x[1],y[1]],[x[0],y[1]],[0,y[2]],[x[3],y[1]],[x[2],y[1]],[x[2],y[0]],[x[1],y[0]]];}
var a=this._parent._valueToAngle(this._value)/180*Math.PI;var ca=Math.cos(a);var sa=Math.sin(a);var w=this._parent.getWidth()/2;var h=this._parent.getHeight()/2;var ps=[];var l=this._ps.length;for(var i=0;i<l;i++){ps.push(this._ps[i][0]*ca+this._ps[i][1]*sa+w);ps.push(this._ps[i][0]*sa-this._ps[i][1]*ca+h);}
ps=ps.join(",");this.setHtmlProperty("points",ps);};_p.layoutComponent=function(){if(this._value==null){var p=this._parent;this.setValue((p.getEndValue()-p.getStartValue())/2+p.getStartValue());}
this._calculatePoints();BiAbstractGauge2ValueMarker.prototype.layoutComponent.call(this);}
function BiGauge2LinearNeedle(){if(_biInPrototype)return;BiAbstractGauge2ValueMarker.call(this);};_p=_biExtend(BiGauge2LinearNeedle,BiAbstractGauge2ValueMarker,"BiGauge2LinearNeedle");BiGauge2LinearNeedle.prototype.getAngle=function(){return this._angle;};BiGauge2LinearNeedle.prototype.setAngle=function(v){this._angle=v;};BiGauge2LinearNeedle.prototype.getNeedlePosition=function(){return this._needlePosition;};BiGauge2LinearNeedle.prototype.setNeedlePosition=function(v){this._needlePosition=v;};BiGauge2LinearNeedle.prototype.getNeedleBase=function(){return this._needleBase;};BiGauge2LinearNeedle.prototype.setNeedleBase=function(v){this._needleBase=v;};BiGauge2LinearNeedle.prototype.getNeedleHeight=function(){return this._needleHeight;};BiGauge2LinearNeedle.prototype.setNeedleHeight=function(v){this._needleHeight=v;};_p._tagName="polyline";_p.setValue=function(n){this._value=n;if(this.getCreated())
this._calculatePoints();};_p._calculatePoints=function(){var r=this._parent._valueToPosition(this._value);if(this._angle==null)
this._angle=this._parent._angle;var angle=this._angle/180*Math.PI;var x=r*Math.sin(angle);var y=r*Math.cos(angle);var nh=this._needlePosition<0?this._needleHeight/2:-this._needleHeight/2;var p1x=x+(this._needlePosition+nh)*Math.cos(angle);var p1y=y-(this._needlePosition+nh)*Math.sin(angle);var tx=x+(this._needlePosition-nh)*Math.cos(angle);var ty=y-(this._needlePosition-nh)*Math.sin(angle);var p2x=tx-this._needleBase/2*Math.sin(angle+Math.PI);var p2y=ty-this._needleBase/2*Math.cos(angle+Math.PI);var p3x=tx+this._needleBase/2*Math.sin(angle+Math.PI);var p3y=ty+this._needleBase/2*Math.cos(angle+Math.PI);var cx=this._parent.getWidth()/2;var cy=this._parent.getHeight()/2;p1x=cx+p1x;p1y=cy-p1y;p2x=cx+p2x;p2y=cy-p2y;p3x=cx+p3x;p3y=cy-p3y;var pointsValue=p3x+","+p3y+" "+p1x+","+p1y+" "+p2x+","+p2y+" "+p3x+","+p3y;this.setHtmlProperty("points",pointsValue);};BiGauge2LinearNeedle.prototype.getValue=function(){return this._value;};_p.layoutComponent=function(){if(this._value==null){var p=this._parent;this.setValue((p.getEndValue()-p.getStartValue())/2+p.getStartValue());}else{this._calculatePoints();}
BiAbstractGauge2ValueMarker.prototype.layoutComponent.call(this);};function BiAbstractGauge2ScaleSection()
{if(_biInPrototype)return;BiGauge2Component.call(this);this.setSectionWidth(20);};_p=_biExtend(BiAbstractGauge2ScaleSection,BiGauge2Component,"BiAbstractGauge2ScaleSection");BiAbstractGauge2ScaleSection.prototype.getStartValue=function(){return this._startValue;};BiAbstractGauge2ScaleSection.prototype.setStartValue=function(v){this._startValue=v;};BiAbstractGauge2ScaleSection.prototype.getEndValue=function(){return this._endValue;};BiAbstractGauge2ScaleSection.prototype.setEndValue=function(v){this._endValue=v;};BiAbstractGauge2ScaleSection.prototype.getSectionWidth=function(){return this._sectionWidth;};BiAbstractGauge2ScaleSection.prototype.setSectionWidth=function(v){this._sectionWidth=v;};function BiGauge2RadialScaleSection(){if(_biInPrototype)return;BiAbstractGauge2ScaleSection.call(this);}
_p=_biExtend(BiGauge2RadialScaleSection,BiAbstractGauge2ScaleSection,"BiGauge2RadialScaleSection");_p._tagName="path";_p._startPoint="M0,0";_p._endPoint="0,0";BiGauge2RadialScaleSection.prototype.getRadius=function(){return this._radius;};BiGauge2RadialScaleSection.prototype.setRadius=function(v){this._radius=v;};BiGauge2RadialScaleSection.prototype.getColor=function(){return this._color;};_p.setColor=function(sColor){this._color=sColor;this.setHtmlProperty("fill",sColor);};_p._calculateAttributes=function(){var r1=this._radius+this._sectionWidth/2;var r2=this._radius-this._sectionWidth/2;var x0=this._parent.getWidth()/2;var y0=this._parent.getHeight()/2;var a0=this._parent._valueToAngle(this._startValue)/180*Math.PI;var a2=this._parent._valueToAngle(this._endValue)/180*Math.PI;var a1=(a0+a2)/2;var isCircle=Math.abs(a2-a0)-2*Math.PI> -0.01;var p0=Math.round(x0+(Math.sin(a0)*r1))+","+Math.round(y0-(Math.cos(a0)*r1));var p1=Math.round(x0+(Math.sin(a1)*r1))+","+Math.round(y0-(Math.cos(a1)*r1));var p2=Math.round(x0+(Math.sin(a2)*r1))+","+Math.round(y0-(Math.cos(a2)*r1));var q0=Math.round(x0+(Math.sin(a0)*r2))+","+Math.round(y0-(Math.cos(a0)*r2));var q1=Math.round(x0+(Math.sin(a1)*r2))+","+Math.round(y0-(Math.cos(a1)*r2));var q2=Math.round(x0+(Math.sin(a2)*r2))+","+Math.round(y0-(Math.cos(a2)*r2));var d;if(!isCircle){d=["M",p0," A",r1,",",r1," 0 0 1 ",p1," A",r1,",",r1," 0 0 1 ",p2," L",q2," A",r2,",",r2," 0 0 0 ",q1," A",r2,",",r2," 0 0 0 ",q0," L",p0];}else{d=["M",p0," A",r1,",",r1," 0 0 1 ",p1," A",r1,",",r1," 0 0 1 ",p2," M",q2," A",r2,",",r2," 0 0 0 ",q1," A",r2,",",r2," 0 0 0 ",q0];}
this.setHtmlProperty("d",d.join(""));};_p.layoutComponent=function(){this._calculateAttributes();BiAbstractGauge2ScaleSection.prototype.layoutComponent.call(this);};function BiGauge2Label()
{if(_biInPrototype)return;BiGauge2Component.call(this);this.setAnchorHorizontal("center");};_p=_biExtend(BiGauge2Label,BiGauge2Component,"BiGauge2Label");_p._tagName="text";_p._font=BiFont.fromString("verdana 50 bold");_p._anchorVertical="middle";_p._color="black";BiGauge2Label.prototype.getX=function(){return this._x;};BiGauge2Label.prototype.setX=function(v){this._x=v;};BiGauge2Label.prototype.getY=function(){return this._y;};BiGauge2Label.prototype.setY=function(v){this._y=v;};_p.setCenterX=_p.getCenterX=_p.setCenterY=_p.getCenterY=Function.EMPTY;_p.setWidth=_p.setHeight=Function.EMPTY;BiGauge2Label._hAlign={"left":"start","center":"middle","right":"end"};BiGauge2Label.prototype.getFont=function(){return this._font;};BiGauge2Label.prototype.setFont=function(v){this._font=v;};_p.setFont=function(o){if(!(o instanceof BiFont)){o=BiFont.fromString(""+o);}
this._font=o;if(o instanceof BiFont){if(o.getBold())
this._setHtmlAttribute("font-weight","bold");if(!o.getSize)o.setSize(50);if(!o.getName())o.setName("verdana");this._setHtmlAttribute("font-family",o.getName());this._setHtmlAttribute("font-size",o.getSize());}};BiGauge2Label.prototype.getAnchorHorizontal=function(){return this._anchorHorizontal;};_p.setAnchorHorizontal=function(sAnchorHorizontal){this._anchorHorizontal=sAnchorHorizontal;this._setHtmlAttribute("text-anchor",BiGauge2Label._hAlign[sAnchorHorizontal]);};BiGauge2Label.prototype.getAnchorVertical=function(){return this._anchorVertical;};BiGauge2Label.prototype.setAnchorVertical=function(v){this._anchorVertical=v;};BiGauge2Label.prototype.getForeColor=function(){return this._foreColor;};_p.setForeColor=function(sColor){this._foreColor=sColor;this._setHtmlAttribute("fill",sColor);};_p._create=function(oDocument){BiGauge2Component.prototype._create.call(this,oDocument);this._textNode=this._document.createTextNode(this._text);var el=this._element;el.appendChild(this._textNode);}
_p.setText=function(sText){this._text=String(sText);var el;if(el=this._element){el.removeChild(el.childNodes[0]);this._textNode=this._document.createTextNode(sText);el.appendChild(this._textNode);}}
_p.getText=function(){return this._text;}
_p.layoutComponent=function(){var el=this._element;var s=Math.floor(this._font.getSize());var w=this._text.length*s;var h=s*0.8;el.setAttribute("x",this._x);switch(this._anchorVertical){case"top":el.setAttribute("y",Math.round(this._y+h/2+h*1.5/2));break;case"bottom":el.setAttribute("y",Math.round(this._y+h/2-h*1.5/2));break;case"middle":default:el.setAttribute("y",Math.round(this._y+h/2));break;}}
_p.dispose=function(){BiGauge2Component.prototype.dispose.call(this);delete this._textNode;}