|
|
@ -10,7 +10,7 @@ export function createEmptyCanvas(id: string, width: number, height: number): vo |
|
|
|
canvasContext.fillStyle = 'white'; |
|
|
|
canvasContext.fillRect(0,0, width, height); |
|
|
|
|
|
|
|
canvasContext.font = "normal 48px Verdana"; |
|
|
|
canvasContext.font = "normal 48px 微软雅黑"; |
|
|
|
canvasContext.fillStyle = "#000000"; |
|
|
|
canvasContext.fillText('暂无数据', (width / 2) - (canvasContext.measureText('暂无数据').width / 2), height / 2 - 24); |
|
|
|
} |
|
|
@ -73,7 +73,7 @@ export class BoxDrawer{ |
|
|
|
let startY = this.paddingTop + this.verticalScaleLine + heightInterval; |
|
|
|
let interval = (this.borderHeight - heightInterval) / (this.colorChart.colors.length) |
|
|
|
|
|
|
|
this.canvasContext.font = "normal 24px Verdana"; |
|
|
|
this.canvasContext.font = "normal 24px 微软雅黑"; |
|
|
|
this.canvasContext.fillStyle = "#000000"; |
|
|
|
|
|
|
|
for(let lastLen = this.colorChart.colors.length - 1, index = lastLen; index >= 0; index --){ |
|
|
@ -250,7 +250,7 @@ export class BoxDrawer{ |
|
|
|
this.canvasContext.translate(x, y); |
|
|
|
this.canvasContext.rotate(Math.PI / 180 * 90); |
|
|
|
this.canvasContext.textBaseline = 'bottom'; |
|
|
|
this.canvasContext.font = "normal 35px Verdana"; |
|
|
|
this.canvasContext.font = "normal 35px 微软雅黑"; |
|
|
|
this.canvasContext.fillStyle = "#000000"; |
|
|
|
this.canvasContext.fillText(str, 0, 0); |
|
|
|
this.canvasContext.restore(); |
|
|
@ -258,7 +258,7 @@ export class BoxDrawer{ |
|
|
|
} else if (str.match(/[\u4E00-\u9FA5]/) && (y < 576)) { |
|
|
|
this.canvasContext.save(); |
|
|
|
this.canvasContext.textBaseline = 'top'; |
|
|
|
this.canvasContext.font = "normal 35px Verdana"; |
|
|
|
this.canvasContext.font = "normal 35px 微软雅黑"; |
|
|
|
this.canvasContext.fillStyle = "#000000"; |
|
|
|
this.canvasContext.fillText(str, x, y); |
|
|
|
this.canvasContext.restore(); |
|
|
@ -268,7 +268,7 @@ export class BoxDrawer{ |
|
|
|
} |
|
|
|
//温度单位
|
|
|
|
private drawTemperatureText(unit): void { |
|
|
|
this.canvasContext.font = "normal 35px Verdana"; |
|
|
|
this.canvasContext.font = "normal 35px 微软雅黑"; |
|
|
|
this.canvasContext.fillStyle = "#000000"; |
|
|
|
let unitX = 1390 |
|
|
|
if (unit === '(degree)') unitX =1350 |
|
|
@ -298,7 +298,7 @@ export class BoxDrawer{ |
|
|
|
this.canvasContext.stroke(); |
|
|
|
|
|
|
|
if (flag){ |
|
|
|
this.canvasContext.font = "normal 30px Verdana"; |
|
|
|
this.canvasContext.font = "normal 30px 微软雅黑"; |
|
|
|
this.canvasContext.fillStyle = "#000000"; |
|
|
|
const text = moment(this.values.radar_data[index].data_time).format("HH:mm"); |
|
|
|
this.canvasContext.fillText(text, _x - this.canvasContext.measureText(text).width / 2, startY + yInterval + this.borderHeight + 36); |
|
|
@ -328,7 +328,7 @@ export class BoxDrawer{ |
|
|
|
this.canvasContext.stroke(); |
|
|
|
|
|
|
|
if (flag) { |
|
|
|
this.canvasContext.font = "normal 30px Verdana"; |
|
|
|
this.canvasContext.font = "normal 30px 微软雅黑"; |
|
|
|
this.canvasContext.fillStyle = "#000000"; |
|
|
|
const text = this.values.radar_info[index].col_factor; |
|
|
|
this.canvasContext.fillText(text, startX - this.canvasContext.measureText(text).width - this.horizontalScaleLine, _y + 10); |
|
|
@ -543,7 +543,7 @@ export class Box implements IBox{ |
|
|
|
} |
|
|
|
|
|
|
|
private setText(canvasContext: any) : void{ |
|
|
|
canvasContext.font = "normal 26px Arial"; |
|
|
|
canvasContext.font = "normal 26px 微软雅黑"; |
|
|
|
canvasContext.fillStyle = "#fafafa"; |
|
|
|
|
|
|
|
const centerX = this.rectX + this.rectWidth / 2; |
|
|
|