chart fix

This commit is contained in:
ZaneYork 2022-01-01 09:27:18 +08:00
parent 8953f3d643
commit b40eed2acc
1 changed files with 7 additions and 8 deletions

View File

@ -100,10 +100,9 @@
categories.add(parseInt(frame))
})
})
categories = Array.from(categories).sort()
json.xAxis = {
categories: categories
}
categories = Array.from(categories).sort(function (a,b) {
return a > b ? 1 : (a === b ? 0 : -1)
})
json.series = $.map(positions, function (position) {
if (!result[rank].hasOwnProperty(position)) {
return null;
@ -118,9 +117,9 @@
},
data: $.map(categories, function (frame) {
if (result[rank][position].hasOwnProperty(frame)) {
return [[parseInt(frame), (parseFloat(result[rank][position][frame].wp) * 100)]]
return [[frame, (parseFloat(result[rank][position][frame].wp) * 100)]]
} else {
return [[parseInt(frame), null]]
return [[frame, null]]
}
})
}, {
@ -134,9 +133,9 @@
},
data: $.map(categories, function (frame) {
if (result[rank][position].hasOwnProperty(frame)) {
return [[parseInt(frame), parseFloat(result[rank][position][frame].adp)]]
return [[frame, parseFloat(result[rank][position][frame].adp)]]
} else {
return [[parseInt(frame), null]]
return [[frame, null]]
}
})
}]