diff --git a/zenno/src/lib/StatChart.svelte b/zenno/src/lib/StatChart.svelte index eb4d6b7..8f5d30b 100644 --- a/zenno/src/lib/StatChart.svelte +++ b/zenno/src/lib/StatChart.svelte @@ -39,7 +39,18 @@ plotOptions?: Omit; } - let { stat, y = [], yArea = [], yLabel, range, xRange, xRule = [], yRule = [], class: className, plotOptions = {} }: Props = $props(); + let { + stat, + y = [], + yArea = [], + yLabel, + range, + xRange, + xRule = [], + yRule = [], + class: className, + plotOptions = {}, + }: Props = $props(); let width = $state(0); let height = $state(0); @@ -58,7 +69,7 @@ } return 100 * Math.ceil(Math.max(1200, ...xLines) / 100); }); - const xVal = $derived(d3.range(xMin, xMax, 5)); + const xVal = $derived(d3.range(xMin, xMax + 1, 5)); // +1 because d3.range does not include the max const thrX = 1200; const series = $derived([y].flat(1).filter((s) => s != null));