mirror of
https://github.com/samsonjs/spirit-tracker.git
synced 2026-04-27 15:07:43 +00:00
UX Improvements
This commit is contained in:
parent
13089e9c7d
commit
372f69f99d
1 changed files with 12 additions and 1 deletions
|
|
@ -782,11 +782,22 @@ export async function renderStats($app) {
|
||||||
min: yBounds?.min,
|
min: yBounds?.min,
|
||||||
max: yBounds?.max,
|
max: yBounds?.max,
|
||||||
title: { display: true, text: "Avg % vs per-SKU median" },
|
title: { display: true, text: "Avg % vs per-SKU median" },
|
||||||
|
|
||||||
ticks: {
|
ticks: {
|
||||||
stepSize: 1, // <- minimum 1% between ticks
|
stepSize: 1,
|
||||||
callback: (v) => `${Number(v).toFixed(0)}%`,
|
callback: (v) => `${Number(v).toFixed(0)}%`,
|
||||||
maxTicksLimit: 12,
|
maxTicksLimit: 12,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
grid: {
|
||||||
|
drawBorder: false,
|
||||||
|
color: (ctx) => {
|
||||||
|
// Only draw for integer % values
|
||||||
|
if (!Number.isInteger(ctx.tick.value)) return "transparent";
|
||||||
|
return ctx.tick.value === 0 ? "rgba(154,166,178,0.35)" : "rgba(154,166,178,0.18)";
|
||||||
|
},
|
||||||
|
lineWidth: 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue