生成图片

master
夜笙歌 6 months ago
parent 2ec8aa8a6d
commit d28986e459

@ -118,7 +118,6 @@
return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`; return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
} }
const getData = () => { const getData = () => {
console.log(222,monitorId)
$.post(prefix + '/newDataStreak', {monitorId}, (e) => { $.post(prefix + '/newDataStreak', {monitorId}, (e) => {
$('#temInfo').html(`<span style="color:#ff0000">最高温度:${e.rows[0].maxTemperature}℃</span> <span style="color:#0b05f7">最低温度:${e.rows[0].minTemperature}℃</span> <span style="color:#0066e4">平均温度:${e.rows[0].avgTemperature}℃</span>`) $('#temInfo').html(`<span style="color:#ff0000">最高温度:${e.rows[0].maxTemperature}℃</span> <span style="color:#0b05f7">最低温度:${e.rows[0].minTemperature}℃</span> <span style="color:#0066e4">平均温度:${e.rows[0].avgTemperature}℃</span>`)
$('#timeInfo').html(`<span style="color:#0b05f7">采集时间:${e.rows[0].collectTime}</span> `) $('#timeInfo').html(`<span style="color:#0b05f7">采集时间:${e.rows[0].collectTime}</span> `)
@ -151,6 +150,7 @@
const gridWidth = width / 32; const gridWidth = width / 32;
const gridHeight = height / 24; const gridHeight = height / 24;
ctx.clearRect(0, 0, width, height)
// 遍历颜色数组,绘制矩形 // 遍历颜色数组,绘制矩形
for (let i = 1; i <= 768; i++) { for (let i = 1; i <= 768; i++) {

Loading…
Cancel
Save