another chart fix

This commit is contained in:
2026-01-27 21:39:27 +11:00
parent 3208a40f14
commit 2127a44872

View File

@@ -47,10 +47,13 @@ function formatTick(value) {
} }
function series(points, key) { function series(points, key) {
return points.map((p) => ({ return points.map((p) => {
x: p.ts, const t = new Date(p.ts).getTime();
return {
x: Number.isNaN(t) ? null : t,
y: p[key] === undefined ? null : p[key], y: p[key] === undefined ? null : p[key],
})); };
});
} }
function filterRange(points, start, end) { function filterRange(points, start, end) {
@@ -197,8 +200,8 @@ function baseOptions(range) {
maxTicksLimit: 6, maxTicksLimit: 6,
callback: (value) => formatTick(value), callback: (value) => formatTick(value),
}, },
min: range && range.axisStart ? range.axisStart : undefined, min: range && range.axisStart ? range.axisStart.getTime() : undefined,
max: range && range.axisEnd ? range.axisEnd : undefined, max: range && range.axisEnd ? range.axisEnd.getTime() : undefined,
grid: { color: "rgba(123, 223, 242, 0.08)" }, grid: { color: "rgba(123, 223, 242, 0.08)" },
}, },
y: { y: {