source: [view]
if(!this._gauge){
return null;
}
var v = this.value;
if(v < this._gauge.min){v = this._gauge.min;}
if(v > this._gauge.max){v = this._gauge.max;}
var pos = this._gauge._getPosition(v);
if(pos == this.dataX){pos = this.dataX+1;}
var y = this._gauge.dataY + Math.floor((this._gauge.dataHeight - this.width)/2) + this.offset;
var shapes = [];
shapes[0] = this._gauge.surface.createRect({x:this._gauge.dataX, y:y, width:pos - this._gauge.dataX, height:this.width});
shapes[0].setStroke({color: this.color});
shapes[0].setFill(this.color);
shapes[1] = this._gauge.surface.createLine({ x1:this._gauge.dataX, y1:y, x2:pos, y2:y });
shapes[1].setStroke({color: this.highlight});
if(this.highlight2){
y--;
shapes[2] = this._gauge.surface.createLine({ x1:this._gauge.dataX, y1:y, x2:pos, y2:y });
shapes[2].setStroke({color: this.highlight2});
}
return shapes;