()
| 49 | } |
| 50 | |
| 51 | drawObject() { |
| 52 | this._ctx.globalCompositeOperation = 'destination-over'; |
| 53 | |
| 54 | // Draw left half text |
| 55 | this._ctx.beginPath(); |
| 56 | this._ctx.rect(this._arrowWidth, this._pctHeight, this._barX - this._arrowWidth, this._meterHeight); |
| 57 | this._ctx.clip(); |
| 58 | |
| 59 | this._shape.fillText(this.displayValue, this._viewWidth / 2, 75, '30px Arial', 'center', this.bgColor); |
| 60 | |
| 61 | this._ctx.fillStyle = this.fillColor; |
| 62 | this._ctx.fillRect(this._arrowWidth, this._pctHeight, this._barX - this._arrowWidth, this._meterHeight); |
| 63 | |
| 64 | this._ctx.restore(); |
| 65 | this.save(); |
| 66 | this._ctx.globalCompositeOperation = 'destination-over'; |
| 67 | |
| 68 | // Draw right half text |
| 69 | this._ctx.beginPath(); |
| 70 | this._ctx.rect(this._barX, this._pctHeight, this._viewWidth - this._barX - this._arrowWidth, this._meterHeight); |
| 71 | this._ctx.clip(); |
| 72 | |
| 73 | this._shape.fillText(this.displayValue, this._viewWidth / 2, 75, '30px Arial', 'center', this.fillColor); |
| 74 | |
| 75 | this._shape.fillRect(this._barX, this._pctHeight, this._viewWidth - this._barX - this._arrowWidth, |
| 76 | this._meterHeight, this.bgColor); |
| 77 | |
| 78 | this._ctx.restore(); |
| 79 | this.save(); |
| 80 | this._ctx.globalCompositeOperation = 'source-over'; |
| 81 | |
| 82 | // Draw the border. |
| 83 | this._ctx.lineWidth = this._lineWidth; |
| 84 | this._ctx.strokeStyle = this._lineColor; |
| 85 | this._ctx.beginPath(); |
| 86 | this._ctx.rect(this._arrowWidth, this._pctHeight, this._meterWidth, this._meterHeight); |
| 87 | this._ctx.stroke(); |
| 88 | this._ctx.closePath(); |
| 89 | |
| 90 | // Draw percentage value |
| 91 | this._ctx.fillStyle = this.markerBgColor; |
| 92 | |
| 93 | this._ctx.fillRect(this._barX - 25, 0, 50, this._actualPctHeight); |
| 94 | this._shape.fillText(this._percentageValue + '%', this._barX, 20, '16px Arial', 'center', this.markerFontColor); |
| 95 | |
| 96 | this._ctx.beginPath(); |
| 97 | this._ctx.fillStyle = this.markerBgColor; |
| 98 | this._ctx.moveTo(this._barX - 8, this._actualPctHeight - this._lineWidth / 2); |
| 99 | this._ctx.lineTo(this._barX, this._pctHeight + this._lineWidth / 2); |
| 100 | this._ctx.lineTo(this._barX + 8, this._actualPctHeight - this._lineWidth / 2); |
| 101 | this._ctx.fill(); |
| 102 | this._ctx.closePath(); |
| 103 | |
| 104 | // Draw arrow. |
| 105 | if (this._arrow === null) { |
| 106 | this.drawLeftArrow(); |
| 107 | this.drawRightArrow(); |
| 108 | } else if (this._arrow === 'left') { |
nothing calls this directly
no test coverage detected