From c04dd01b41f31f3889d27caa00bf1cfb1af95793 Mon Sep 17 00:00:00 2001 From: xiaowuler Date: Thu, 5 May 2022 14:12:08 +0800 Subject: [PATCH] modify some codes --- .../Frontend/src/model/heat-map-drawer.ts | 3 +-- 04.系统编码/Frontend/src/uilts/box-drawer.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/04.系统编码/Frontend/src/model/heat-map-drawer.ts b/04.系统编码/Frontend/src/model/heat-map-drawer.ts index 1838a57..5fc3016 100644 --- a/04.系统编码/Frontend/src/model/heat-map-drawer.ts +++ b/04.系统编码/Frontend/src/model/heat-map-drawer.ts @@ -1,4 +1,3 @@ -import moment from "moment"; import { Box, Calc, ColorChart } from "../uilts/box-drawer"; export class HeatMapDrawer{ @@ -254,7 +253,7 @@ export class HeatMapDrawer{ let name = "高度(m)"; this.canvasContext.translate(90, this.height / 2 + this.paddingTop - this.canvasContext.measureText(name).width); this.canvasContext.rotate(Math.PI * 1.5); - this.canvasContext.font="normal 24px 微软雅黑"; + this.canvasContext.font="normal 22px 微软雅黑"; this.canvasContext.fillStyle="#000000"; this.canvasContext.fillText(name, 0, 0); this.canvasContext.restore(); diff --git a/04.系统编码/Frontend/src/uilts/box-drawer.ts b/04.系统编码/Frontend/src/uilts/box-drawer.ts index 9e8b178..dbe3239 100644 --- a/04.系统编码/Frontend/src/uilts/box-drawer.ts +++ b/04.系统编码/Frontend/src/uilts/box-drawer.ts @@ -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{