From e89996bc27e8d35610742adcbcf97ba06b28c7c9 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Fri, 8 Jan 2021 00:09:12 +0100 Subject: [PATCH] Omit zero interval, and don't nice the values * to keep promise of radio buttons: * 1 month should mean 30/31 days --- ts/graphs/intervals.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ts/graphs/intervals.ts b/ts/graphs/intervals.ts index 4b4fd3661..1bd00a307 100644 --- a/ts/graphs/intervals.ts +++ b/ts/graphs/intervals.ts @@ -84,13 +84,12 @@ export function prepareIntervalData( case IntervalRange.All: break; } - const xMin = 0; + const xMin = 1; xMax = xMax! + 1; // cap bars to available range const desiredBars = Math.min(70, xMax! - xMin!); - - const scale = scaleLinear().domain([xMin!, xMax!]).nice(); + const scale = scaleLinear().domain([xMin!, xMax!]); const bins = histogram() .domain(scale.domain() as any) .thresholds(scale.ticks(desiredBars))(allIntervals);