money: room under the €0 baseline so it sits clear of the chart edge and small dips below zero show
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
let values = $derived(series.flatMap((item) => item.points.map((point) => point.value)));
|
||||
let times = $derived(series.flatMap((item) => item.points.map((point) => time(point.date))));
|
||||
let scale = $derived(niceScale(Math.min(0, ...values), Math.max(0, ...values)));
|
||||
let min = $derived(scale.min);
|
||||
// Money charts keep a little room under €0 so the baseline sits clear of the bottom edge and
|
||||
// small dips below zero stay visible.
|
||||
let min = $derived(showZero && scale.min === 0 && scale.max > 0 ? -scale.max * 0.06 : scale.min);
|
||||
let max = $derived(scale.max);
|
||||
let span = $derived(max - min || 1);
|
||||
let from = $derived(Math.min(...times));
|
||||
|
||||
Reference in New Issue
Block a user