放大走势图

master
宇天 2020-07-30 15:02:11 +08:00
parent 4891a5b5e6
commit 00c341e2a9
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "io.yutent.gaystat",
"version": "1.4.0",
"version": "1.5.0",
"description": "搞基数据",
"main": "src/main.js",
"scripts": {

View File

@ -31,6 +31,7 @@ function getTableData(str) {
var table = document.createElement('table')
var list = []
var max = 0
var min = 99
table.innerHTML = match[0]
list = Array.from(table.children[0].children)
@ -39,13 +40,15 @@ function getTableData(str) {
if (m > max) {
max = m
}
if (m < min) {
min = m
}
return { m }
})
.reverse()
max = Math.ceil(max)
list.forEach(it => {
it.h = +((it.m * 30) / max).toFixed(2)
it.h = +(((it.m - min) * 25) / (max - min)).toFixed(2)
})
return list
}