|
|
@ -441,8 +441,8 @@ export class Box implements IBox{ |
|
|
|
time: string; |
|
|
|
util: string; |
|
|
|
//提示框的宽高
|
|
|
|
rectWidth: number = 340; |
|
|
|
rectHeight: number = 120; |
|
|
|
rectWidth: number = 240; |
|
|
|
rectHeight: number = 90; |
|
|
|
rectX: number; |
|
|
|
rectY: number; |
|
|
|
|
|
|
@ -543,16 +543,16 @@ export class Box implements IBox{ |
|
|
|
} |
|
|
|
|
|
|
|
private setText(canvasContext: any) : void{ |
|
|
|
canvasContext.font = "normal 26px 微软雅黑"; |
|
|
|
canvasContext.font = "normal 20px 微软雅黑"; |
|
|
|
canvasContext.fillStyle = "#fafafa"; |
|
|
|
|
|
|
|
const centerX = this.rectX + this.rectWidth / 2; |
|
|
|
const timeText = "time:" + this.time; |
|
|
|
canvasContext.fillText(timeText, centerX - canvasContext.measureText(timeText).width / 2, this.rectY + 30); |
|
|
|
canvasContext.fillText(timeText, centerX - canvasContext.measureText(timeText).width / 2, this.rectY + 25); |
|
|
|
const valueText = 'value:' + this.value.toPrecision(3); |
|
|
|
canvasContext.fillText(valueText, centerX - canvasContext.measureText(valueText).width / 2, this.rectY + 22 + 45); |
|
|
|
canvasContext.fillText(valueText, centerX - canvasContext.measureText(valueText).width / 2, this.rectY + 8 + 45); |
|
|
|
const heightText = 'height:' + this.dataHeight + ' ' + this.util; |
|
|
|
canvasContext.fillText(heightText, centerX - canvasContext.measureText(heightText).width / 2, this.rectY + 22 + 22 + 60); |
|
|
|
canvasContext.fillText(heightText, centerX - canvasContext.measureText(heightText).width / 2, this.rectY + 8 + 12 + 60); |
|
|
|
} |
|
|
|
|
|
|
|
private setSelectStyle(canvasContext: any): void{ |
|
|
|