gauge2.ie_wev8.js
40.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
function BiVmlComponent()
{if(_biInPrototype)return;BiComponent.call(this);}
_p=_biExtend(BiVmlComponent,BiComponent,"BiVmlComponent");_p._tagName="v:group";if(BiBrowserCheck.ie){try{if(!document.namespaces["v"])
document.namespaces.add("v","urn:schemas-microsoft-com:vml");}catch(e){}}
_p.setViewBox=function(nMinX,nMinY,nWidth,nHeight){this.setHtmlProperty("coordsize",""+nWidth+" "+nHeight);this.setHtmlProperty("coordorigin",""+nMinX+" "+nMinY);};_p.createVmlElement=function(name)
{return this._document.createElement("v:"+name);};function BiGauge2(){if(_biInPrototype)return;BiComponent.call(this);this._gauge2Group=new BiGauge2Group;BiComponent.prototype.add.call(this,this._gauge2Group);this._gauge2Group.setLeft(0);this._gauge2Group.setRight(0);this._gauge2Group.setTop(0);this._gauge2Group.setBottom(0);this.setCoordWidth(1000);this.setCoordHeight(1000);};_p=_biExtend(BiGauge2,BiComponent,"BiGauge2");BiGauge2._addNs=function(d){if(!d.namespaces["v"]){d.namespaces.add("v","urn:schemas-microsoft-com:vml");}};BiGauge2.setViewBox=function(o,nX,nY,nWidth,nHeight){o.setHtmlProperty("coordsize",""+nWidth+" "+nHeight);o.setHtmlProperty("coordorigin",""+nX+" "+nY);};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;};_p.add=function(oChild){oChild._gaugeComponent=this;this._gauge2Group.add(oChild);};_p._create=function(oDocument){BiComponent.prototype._create.call(this,oDocument);BiGauge2._addNs(this._document);var el=this._document.createElement("div");el.setAttribute("id","testLabelSize");el.style.visibility="hidden";el.style.height="1px";el.style.width="1px";el.style.position="absolute";this._element.appendChild(el);};_p.layoutAllChildren=function(){BiGauge2.setViewBox(this._gauge2Group,0,0,this.getCoordWidth(),this.getCoordHeight());BiComponent.prototype.layoutAllChildren.call(this);};function BiGauge2Group(){if(_biInPrototype)return;BiComponent.call(this);};_p=_biExtend(BiGauge2Group,BiComponent,"BiGauge2Group");_p._tagName="v:group";_p.getClientWidth=function(){return this._parent.getClientWidth();};_p.getClientHeight=function(){return this._parent.getClientHeight();};function BiGauge2Component(){if(_biInPrototype)return;BiComponent.call(this);this.setHtmlProperty("stroked","f");};_p=_biExtend(BiGauge2Component,BiComponent,"BiGauge2Component");_p._addHtmlElementToParent=function(oParent,oBefore){if(this._created){this._setHtmlProperties();}
BiComponent.prototype._addHtmlElementToParent.call(this,oParent,oBefore);}
BiGauge2Component.prototype.getFiller=function(){return this._filler;};BiGauge2Component.prototype.setFiller=function(v){this._filler=v;};BiGauge2Component.prototype.getCenterX=function(){return this._centerX;};_p.setCenterX=function(nCenterX){this._centerX=nCenterX;this.setLeft(nCenterX-(this._width/2));};BiGauge2Component.prototype.getCenterY=function(){return this._centerY;};_p.setCenterY=function(nCenterY){this._centerY=nCenterY;this.setTop(nCenterY-(this._height/2));};_p.add=function(oChild){BiComponent.prototype.add.call(this,oChild);};_p.setFiller=function(oFiller){if(this._filler)
this._filler.dispose();this._filler=oFiller;oFiller.applyFiller(this);};_p.setWidth=function(nWidth){BiComponent.prototype.setWidth.call(this,nWidth);this.setCenterX(this._centerX);};_p.setHeight=function(nHeight){BiComponent.prototype.setHeight.call(this,nHeight);this.setCenterY(this._centerY);};_p.getWidth=function(){return this._width;};_p.getHeight=function(){return this._height;};_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;};BiGauge2Component.prototype.setStroke=function(v){this._stroke=v;};BiGauge2Component.prototype.getStrokeWidth=function(){return this._strokeWidth;};BiGauge2Component.prototype.setStrokeWidth=function(v){this._strokeWidth=v;};_p.setStroke=function(sStroke){this._stroke=sStroke;this.setHtmlProperty("stroked",(sStroke&&sStroke.length>0)?"True":"False");this.setHtmlProperty("strokecolor",sStroke);};_p.setStrokeWidth=function(nStrokeWidth){this._strokeWidth=nStrokeWidth;this.setHtmlProperty("stroked",(nStrokeWidth&&nStrokeWidth>0)?"True":"False");this.setHtmlProperty("strokeweight",nStrokeWidth*this._getScaleFactor());};_p._getGaugeComponent=function(){if(!this._gaugeComponent){var p=this._parent;while(p._tagName.toUpperCase()!="DIV")
p=p._parent;this._gaugeComponent=p;}
return this._gaugeComponent;};_p._getScaleFactor=function(){if(!this._parent)
return 0;var g=this._getGaugeComponent();return Math.min(g.getClientWidth()/g.getCoordWidth(),g.getClientHeight()/g.getCoordHeight());};_p._getScaleHeight=function(){if(!this._parent)
return 0;return this._getGaugeComponent().getClientHeight();};_p.layoutComponent=function(){BiComponent.prototype.layoutComponent.call(this);this._resizeNonScalable();};_p._resizeNonScalable=function(){this.setStrokeWidth(this._strokeWidth);};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;BiComponent.call(this);};_p=_biExtend(BiGauge2ArcBorder,BiAbstractGauge2Border,"BiGauge2ArcBorder");_p._tagName="v:shape";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 r=1000;var a0=this._startAngle/180*Math.PI;var a1=this._endAngle/180*Math.PI;var el=this._element;el.coordorigin= -r+" "+ -r;el.coordsize=2*r+" "+2*r;var p0=Math.round(Math.sin(a0)*r)+" "+Math.round(-Math.cos(a0)*r);var p1=Math.round(Math.sin(a1)*r)+" "+Math.round(-Math.cos(a1)*r);el.path=["m ",p0," wr ",-r," ",-r," ",r," ",r," ",p0," ",p1," l ",p0].join("");}
function BiGauge2CircularBorder(){if(_biInPrototype)return;BiComponent.call(this);};_p=_biExtend(BiGauge2CircularBorder,BiAbstractGauge2Border,"BiGauge2CircularBorder");_p._tagName="v:oval";function BiGauge2RectangularBorder(){if(_biInPrototype)return;BiAbstractGauge2Border.call(this);this.setArcSize(0);};_p=_biExtend(BiGauge2RectangularBorder,BiAbstractGauge2Border,"BiGauge2RectangularBorder");_p._tagName="v:roundrect";BiGauge2RectangularBorder.prototype.getArcSize=function(){return this._arcSize;};BiGauge2RectangularBorder.prototype.setArcSize=function(v){this._arcSize=v;};_p.setArcSize=function(nArcSize){this._arcSize=nArcSize;this.setHtmlProperty("arcsize",nArcSize+"%");};BiGauge2RectangularBorder.prototype.getAngle=function(){return this._angle;};BiGauge2RectangularBorder.prototype.setAngle=function(v){this._angle=v;};_p.setAngle=function(n){this._angle=n;this.setStyleProperty("rotation",n+"deg");}
function BiGauge2ImageBorder(){if(_biInPrototype)return;BiAbstractGauge2Border.call(this);this.setHtmlProperty("preserveAspectRatio","none");};_p=_biExtend(BiGauge2ImageBorder,BiAbstractGauge2Border,"BiGauge2ImageBorder");_p._tagName="v:image";BiGauge2ImageBorder.prototype.getSUri=function(){return this._sUri;};_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("src",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;BiComponent.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("fillcolor",(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="v:fill";_p._used=false;_p.setColor1=function(sCol){this._color1=sCol;if(this._parent)
this._parent.setHtmlProperty("fillcolor",sCol);}
_p.setColor2=function(sCol){this._color2=sCol;this.setHtmlProperty("color2",sCol)}
_p.setOpacity1=function(n){this._opacity1=n;this.setHtmlProperty("opacity",n);}
_p.setOpacity2=function(n){this._opacity2=n;this.setHtmlProperty("opacity2",n);}
_p.setXpos=function(n){this._xpos=n;this.setHtmlProperty("focusposition",this.getXpos()+"%,"+this.getYpos()+"%");}
_p.setYpos=function(n){this._ypos=n;this.setHtmlProperty("focusposition",this.getXpos()+"%,"+this.getYpos()+"%");}
_p.applyFiller=function(oGroupChild){if(!this._used){oGroupChild.setHtmlProperty("fillcolor",this.getColor1());this.setHtmlProperty("color2",this.getColor2());this.setHtmlProperty("opacity",this.getOpacity1());this.setHtmlProperty("opacity2",this.getOpacity2());this.setHtmlProperty("focus","100%");this.setHtmlProperty("focusposition",this.getXpos()+"%,"+this.getYpos()+"%");this.setHtmlProperty("type","gradientRadial");this.setHtmlProperty("method","None");oGroupChild.add(this);this._used=true;}};function BiGauge2RingGradientFiller(){if(_biInPrototype)return;BiAbstractGauge2GradientFiller.call(this);};_p=_biExtend(BiGauge2RingGradientFiller,BiAbstractGauge2GradientFiller,"BiGauge2RingGradientFiller");_p._tagName="v:fill";_p._used=false;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.setColor1=function(sCol){this._color1=sCol;if(this._parent)
this._parent.setHtmlProperty("fillcolor",sCol);}
_p.setColor2=function(sCol){this._color2=sCol;this.setHtmlProperty("color2",sCol)}
_p.setOpacity1=function(n){this._opacity1=n;this.setHtmlProperty("opacity",n);}
_p.setOpacity2=function(n){this._opacity2=n;this.setHtmlProperty("opacity2",n);}
_p.setXpos=function(n){this._xpos=n;if(this._created)
this._calculateFocus();}
_p.setYpos=function(n){this._ypos=n;if(this._created)
this._calculateFocus();}
_p.setThickness=function(n){this._thickness=n;if(this._created)
this._calculateFocus();}
_p.setHighlightCenter=function(n){this._highlightCenter=n;if(this._created)
this._calculateFocus();}
_p._calculateFocus=function(){var x=this._xpos-50+this._thickness;var y=this._ypos-50+this._thickness;this.setHtmlProperty("focus",this._highlightCenter+"%");this.setHtmlProperty("focusposition",x+"%,"+y+"%");var focusSize=100-this._thickness*2;this.setHtmlProperty("focussize",focusSize+"%,"+focusSize+"%");}
_p.applyFiller=function(oGroupChild){if(!this._used){oGroupChild.setHtmlProperty("fillcolor",this.getColor1());this.setHtmlProperty("color2",this.getColor2());this.setHtmlProperty("opacity",this.getOpacity1());this.setHtmlProperty("opacity2",this.getOpacity2());this._calculateFocus();this.setHtmlProperty("type","gradientRadial");this.setHtmlProperty("method","none");oGroupChild.add(this);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="v:fill";_p._used=false;_p.setColor1=function(sCol){this._color1=sCol;if(this._parent)
this._parent.setHtmlProperty("fillcolor",sCol);}
_p.setColor2=function(sCol){this._color2=sCol;this.setHtmlProperty("color2",sCol)}
_p.setOpacity1=function(n){this._opacity1=n;this.setHtmlProperty("opacity",n);}
_p.setOpacity2=function(n){this._opacity2=n;this.setHtmlProperty("opacity2",n);}
_p.setAngle=function(n){this._angle=n;this.setHtmlProperty("angle",n);}
_p.applyFiller=function(oGroupChild){if(!this._used){oGroupChild.setHtmlProperty("fillcolor",this.getColor1());this.setHtmlProperty("color2",this.getColor2());this.setHtmlProperty("opacity",this.getOpacity1());this.setHtmlProperty("opacity2",this.getOpacity2());this.setHtmlProperty("angle",this.getAngle());this.setHtmlProperty("focus","100%");this.setHtmlProperty("type","gradient");oGroupChild.add(this);this._used=true;}};function BiAbstractGauge2Range(){if(_biInPrototype)return;BiGauge2Component.call(this);};_p=_biExtend(BiAbstractGauge2Range,BiGauge2Component,"BiAbstractGauge2Range");_p._tagName="v:group";_p.setWidth=function(nWidth){this._width=nWidth;this.setStyleProperty("width",nWidth);BiGauge2.setViewBox(this,0,0,this._width,this._height);this.setCenterX(this._centerX);};_p.setHeight=function(nHeight){this._height=nHeight;this.setStyleProperty("height",nHeight);BiGauge2.setViewBox(this,0,0,this._width,this._height);this.setCenterY(this._centerY);};_p.layoutComponent=function(){BiComponent.prototype.layoutComponent.call(this);this.invalidateLayout();};_p.layoutAllChildren=function(){var w=this.getWidth();var h=this.getHeight();var cs=this._children;var l=cs.length;for(var i=0;i<l;i++){if(!(cs[i]instanceof BiGauge2Label))
cs[i].setPosition(w/2,h/2);if(cs[i]instanceof BiAbstractGauge2Ticks)
cs[i].setSize(w,h);if(cs[i]instanceof BiAbstractGauge2Scale){cs[i].setSize(w,h);}
cs[i].layoutComponent();}
this._invalidLayout=false;};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=="v:group"){BiGauge2.setViewBox(oChild,0,0,this._width,this._height);}
if(oChild instanceof BiAbstractGauge2Border){oChild.setSize(this.getWidth(),this.getHeight());}
BiAbstractGauge2Range.prototype.add.call(this,oChild);};function BiGauge2LinearRange(nCenterX,nCenterY,nWidth,nHeight,nAngle){if(_biInPrototype)return;BiAbstractGauge2Range.call(this,nCenterX,nCenterY,nWidth,nHeight);this.setAngle(nAngle?nAngle:0);};_p=_biExtend(BiGauge2LinearRange,BiAbstractGauge2Range,"BiGauge2LinearRange");BiGauge2LinearRange.prototype.getAngle=function(){return this._angle;};BiGauge2LinearRange.prototype.setAngle=function(v){this._angle=v;};_p.add=function(oChild){if(oChild._tagName=="v:group"){BiGauge2.setViewBox(oChild,0,0,this.getWidth(),this.getHeight());oChild.setSize(this.getWidth(),this.getHeight());}
BiAbstractGauge2Range.prototype.add.call(this,oChild);};function BiAbstractGauge2Ticks(){if(_biInPrototype)return;BiGauge2Component.call(this);this._ticks=[];};_p=_biExtend(BiAbstractGauge2Ticks,BiGauge2Component,"BiAbstractGauge2Ticks");_p._tagName="v:group";BiAbstractGauge2Ticks.prototype.getTickWidth=function(){return this._tickWidth;};_p.setTickWidth=function(nTickWidth){this._tickWidth=nTickWidth;this.setStrokeWidth(nTickWidth);};_p.setStrokeWidth=function(nStrokeWidth){this._strokeWidth=nStrokeWidth;var l=this._ticks.length;for(var i=0;i<l;i++){var tick=this._ticks[i];tick.strokeweight=nStrokeWidth*this._getScaleFactor()+"px";}};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;};BiAbstractGauge2Ticks.prototype.setColor=function(v){this._color=v;};_p.setColor=function(sColor){this._color=sColor;this.setHtmlProperty("strokecolor",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].strokecolor=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-tl/2;var r2=r+tl/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()+tl)/2;var offsetY=(this._parent.getHeight()+tl)/2;var sf=this._getScaleFactor();for(var i=0;i<this._tickCount;i++,angle+=angleStep){var el=this._document.createElement("v:shape");el.strokecolor=this.getColorFunction().call(this,i);el.strokeweight=this._strokeWidth*sf+"px";el.stroked=true;el.style.width=tl;el.style.height=tl;el.coordorigin=(tl/2)+" "+(tl/2);el.coordsize=tl+" "+tl;el.style.left=Math.round(offsetX+r*Math.sin(angle));el.style.top=Math.round(offsetY-r*Math.cos(angle));var x1= -Math.round(tl/2*Math.sin(angle));var y1=Math.round(tl/2*Math.cos(angle));var x2= -x1;var y2= -y1;el['path']="m"+x1+","+y1+"l"+x2+","+y2+" e";this._element.appendChild(el);this._ticks.push(el);}};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;var offsetX=(this._parent.getWidth()+tl)/2;var offsetY=(this._parent.getHeight()+tl)/2;var x1= -Math.round(tl/2*Math.cos(angle));var y1=Math.round(tl/2*Math.sin(angle));var x2= -x1;var y2= -y1;var path="m"+x1+","+y1+"l"+x2+","+y2+" e";var sf=this._getScaleFactor();for(var i=0;i<n;i++){var el=this._document.createElement("v:shape");el.strokecolor=this.getColorFunction().call(this,i);el.strokeweight=this._strokeWidth*sf+"px";el.stroked=true;el.style.width=tl;el.style.height=tl;el.coordorigin=(tl/2)+" "+(tl/2);el.coordsize=tl+" "+tl;el.style.left=Math.round(offsetX+r*Math.sin(angle));el.style.top=Math.round(offsetY-r*Math.cos(angle));el['path']=path;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._tagName="v:group";_p._font=BiFont.fromString("Arial 20");_p._verticalAlign="middle";_p._preString="";_p._postString="";BiAbstractGauge2Scale.prototype.getFont=function(){return this._font;};_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.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.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.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;};}
_p._resizeLabels=function(){var sf=this._getScaleFactor();var s=Math.floor(sf*this._font.getSize());if(sf==0)return;for(var i=0;i<this._labels.length;i++){var w=Math.round(this._labels[i].a!="right"?this._labels[i].label.innerText.length*s/sf:6*s/sf);var h=Math.round(s/sf*1.2);this._labels[i].label.style.fontSize=s+"px";this._labels[i].label.style.height=h+"px";this._labels[i].label.style.width=w+"px";if(this._labels[i].a!="right"){this._labels[i].label.style.left=Math.round(this._labels[i].x-w/2);}
else this._labels[i].label.style.left=Math.round(this._labels[i].x-w);if(!this._labels[i]._topIsSet){this._labels[i]._topIsSet=true;this._labels[i].label.style.top=Math.round(this._labels[i].y-h/2);}}};_p.layoutComponent=function(){if(!this._labelsCreated){this._createLabels();this._labelsCreated=true;}
this._resizeLabels();BiGauge2Component.prototype.layoutComponent.call(this);this.invalidateLayout();};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._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 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].label.style.color=cs[ai];else break;}}};_p._createLabel=function(nValue){var v=this._valueToAngle(nValue);nValue=this.getValueFunction().call(this,nValue);var vr=v/180*Math.PI;var r=this.getRadius();var x=r*Math.sin(vr);var y=r*Math.cos(vr);x=this.getWidth()/2+x;y=this.getHeight()/2-y;var el=this._document.createElement("v:shape");el.style.textAlign="center";el.style.color=this.getColorFunction().call(this,nValue);el.style.fontFamily=this._font.getName();el.innerText=this._preString+nValue+this._postString;if(this._font.getBold())
el.style.fontWeight="bold";if(this._element.hasChildNodes())
this._element.insertBefore(el,this._element.firstChild);else this._element.appendChild(el);return{label:el,x:x,y:y,a:"center"};};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._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 n=this._labelCount;var labels=[];var step=(this.getEndValue()-this.getStartValue())/(n-1);var v=this.getStartValue();var r= -((n-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].label.style.color=cs[ai];else break;}}};_p._createLabel=function(nValue,r,angle){nValue=this.getValueFunction().call(this,nValue);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._document.createElement("v:shape");el.style.textAlign=(Math.abs(this._angle)>60?"center":"right");el.style.color=this.getColorFunction().call(this,nValue);el.innerText=this._preString+nValue+this._postString;el.style.fontFamily=this._font.getName();if(this._font.getBold())
el.style.fontWeight="bold";if(this._element.hasChildNodes())
this._element.insertBefore(el,this._element.firstChild);else this._element.appendChild(el);return{label:el,x:x1,y:y1,a:(Math.abs(this._angle)>60?"center":"right")};};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="v:oval";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="v:polyline";_p._value=null;_p.setValue=function(nValue){this._value=nValue;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;try{this._element.points.value=pointsValue;}
catch(ex){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="v:polyline";_p._value=null;BiGauge2RadialArrowNeedle.prototype.getPointerLength=function(){return this._pointerLength;};BiGauge2RadialArrowNeedle.prototype.setPointerLength=function(v){this._pointerLength=v;};_p.setValue=function(nValue){this._value=nValue;if(this._parent)
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(",");try{this._element.points.value=ps;}
catch(ex){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="v: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;try{this._element.points.value=pointsValue;}
catch(ex){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 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);this.setHtmlProperty("filled",true);};_p=_biExtend(BiGauge2RadialScaleSection,BiAbstractGauge2ScaleSection,"BiGauge2RadialScaleSection");_p._tagName="v:shape";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("fillcolor",sColor);};_p.setSectionWidth=function(nSectionWidth){this._sectionWidth=nSectionWidth;};_p._calculateAttributes=function(){var r1=this._radius+this._sectionWidth/2;var r2=this._radius-this._sectionWidth/2;var w=this._parent.getWidth();var h=this._parent.getHeight();var x0=w/2;var y0=h/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 el=this._element;el.style.width=w;el.style.height=h;el.coordorigin= -x0+" "+ -y0;el.coordsize=w+" "+h;r1=Math.round(r1);r2=Math.round(r2);var p0,p1,p2;if(a1>a0){p0=Math.round(Math.sin(a2)*r1)+" "+Math.round(-Math.cos(a2)*r1);p1=Math.round(Math.sin(a1)*r1)+" "+Math.round(-Math.cos(a1)*r1);p2=Math.round(Math.sin(a0)*r1)+" "+Math.round(-Math.cos(a0)*r1);}else{p0=Math.round(Math.sin(a0)*r1)+" "+Math.round(-Math.cos(a0)*r1);p1=Math.round(Math.sin(a1)*r1)+" "+Math.round(-Math.cos(a1)*r1);p2=Math.round(Math.sin(a2)*r1)+" "+Math.round(-Math.cos(a2)*r1);}
var d;if(!isCircle){d=["ar",-r1," ",-r1," ",r1," ",r1," ",p0," ",p2,"wa",-r2," ",-r2," ",r2," ",r2," ",p2," ",p0," x"];}else{d=["ar",-r1," ",-r1," ",r1," ",r1," ",p0," ",p1,"at",-r1," ",-r1," ",r1," ",r1," ",p1," ",p2,"wr",-r2," ",-r2," ",r2," ",r2," ",p2," ",p1,"wa",-r2," ",-r2," ",r2," ",r2," ",p1," ",p0];}
el.path=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="v:shape";_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.prototype.getAnchorHorizontal=function(){return this._anchorHorizontal;};_p.setAnchorHorizontal=function(sAnchorHorizontal){this._anchorHorizontal=sAnchorHorizontal;this.setStyleProperty("textAlign",sAnchorHorizontal);};BiGauge2Label.prototype.getAnchorVertical=function(){return this._anchorVertical;};BiGauge2Label.prototype.setAnchorVertical=function(v){this._anchorVertical=v;};BiGauge2Label.prototype.getForeColor=function(){return this._foreColor;};_p.setColor=function(sColor){this._foreColor=sColor;this.setStyleProperty("color",sColor);};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.setStyleProperty("fontWeight","bold");if(!o.getSize)o.setSize(50);if(!o.getName())o.setName("verdana");this.setStyleProperty("fontFamily",o.getName());}};_p._create=function(oDocument){BiGauge2Component.prototype._create.call(this,oDocument);var el=this._element;el.innerText=this._text;}
_p.setText=function(sText){this._text=String(sText);if(this._created){this._element.innerText=this._text;}}
_p.getText=function(){return this._text;}
_p.layoutComponent=function(){var el=this._element;var sf=this._getScaleFactor()||1;var s=this._font.getSize();var w=Math.round(this._text.length*s);var h=Math.round(s*1.3);el.style.fontSize=Math.round(s*sf)+"px";el.style.width=w+"px";el.style.height=h+"px";el.style.top=Math.round(this._y-h/2);switch(this._anchorHorizontal){case"center":el.style.left=Math.round(this._x-w/2);break;case"left":el.style.left=this._x;break;case"right":el.style.left=this._x-w;break;}
switch(this._anchorVertical){case"top":el.style.top=this._y;break;case"middle":el.style.top=Math.round(this._y-h/2);break;case"bottom":el.style.top=this._y-h;break;}}