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