feat: y-axis SI prefix, hide tick from legend, fix table sort
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import uPlot from 'uplot';
|
||||
import type { ChartConfig } from '@/lib/types';
|
||||
import { formatSI } from '@/lib/formatNumber';
|
||||
|
||||
// --- Color helpers ---
|
||||
|
||||
@@ -164,7 +165,7 @@ export function makeSignalsSeries(
|
||||
];
|
||||
}
|
||||
|
||||
export function makeSignalsAxes(timeMode: 'real' | 'tick'): uPlot.Axis[] {
|
||||
export function makeSignalsAxes(timeMode: 'real' | 'tick', locale?: string): uPlot.Axis[] {
|
||||
return [
|
||||
{
|
||||
...AXIS_BASE,
|
||||
@@ -173,6 +174,10 @@ export function makeSignalsAxes(timeMode: 'real' | 'tick'): uPlot.Axis[] {
|
||||
vals.map(v => v == null ? '' : new Date(v * 1000).toLocaleTimeString()),
|
||||
}),
|
||||
},
|
||||
{ ...AXIS_BASE },
|
||||
{
|
||||
...AXIS_BASE,
|
||||
values: (_u: uPlot, vals: (number | null)[]) =>
|
||||
vals.map(v => v == null ? '' : formatSI(v, locale)),
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user