mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
vmui: fixed yaxis labels (#2448)
This commit is contained in:
parent
4197c61ef8
commit
46a1e28ed7
1 changed files with 1 additions and 4 deletions
|
@ -29,10 +29,7 @@ export const defaultOptions = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const formatTicks = (u: uPlot, ticks: number[], unit = ""): string[] => {
|
export const formatTicks = (u: uPlot, ticks: number[], unit = ""): string[] => {
|
||||||
return ticks.map(v => {
|
return ticks.map(v => `${v.toLocaleString()} ${unit}`);
|
||||||
const n = Math.abs(v);
|
|
||||||
return `${n > 1e-3 && n < 1e4 ? v.toString() : v.toExponential(1)} ${unit}`;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface AxisExtend extends Axis {
|
interface AxisExtend extends Axis {
|
||||||
|
|
Loading…
Reference in a new issue