Browse Source

modify some codes

master
xiaowuler 3 years ago
parent
commit
c04dd01b41
  1. 3
      04.系统编码/Frontend/src/model/heat-map-drawer.ts
  2. 12
      04.系统编码/Frontend/src/uilts/box-drawer.ts

3
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();

12
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{

Loading…
Cancel
Save