fix(me): 24h 调用分布空白 —— IP.chart.bars 用法错 (1.0.31)
me.html 把 24 小时数据(hour_24h 数组)传给 IP.chart.bars 时,
写成了 `{name: "调用数", values: [...]}` —— 但 chart.js.bars
的 items 期望 `{label, value}` 单值(每行一根 bar)。
实际 hour_24h 是有数据的(wugui 24h 1276 次,分布 11 个小时槽非 0),
但前端渲染失败显示空白 —— 用户看不到自己的 24h 分布。
修:每 hour 一行 item,传 label="h时" / value=v。
顺便 hourly.js 检查过了——它自己写 SVG heatmap 不走 bars,不受影响。
回归 238/0 全绿。
This commit is contained in:
1 parent
faae6b95d4
commit
57d0f19c9f
1 file changed
+4
-2
+4
-2
@@ -75,9 +75,11 @@
|
||||
|
||||
function renderHourly(hour24) {
|
||||
var el = $("dHourChart");
|
||||
var items = hour24.map(function (v, h) {
|
||||
return { label: h + "时", value: Number(v) || 0 };
|
||||
});
|
||||
IP.chart.bars(el, {
|
||||
labels: hour24.map(function (_, i) { return i; }),
|
||||
items: [{ name: "调用数", values: hour24.map(function (v) { return Number(v) || 0; }) }],
|
||||
items: items,
|
||||
emptyText: "过去 24 小时没有调用记录"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user