From 3fae75f71f40c209470316e9dc6dc0281c1f18d0 Mon Sep 17 00:00:00 2001 From: Wadah Esam Date: Tue, 14 Nov 2023 02:12:22 +0300 Subject: [PATCH] fix: area chart showing artifact at the begging of the chart --- src/utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index e64640f..7be5c55 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -85,6 +85,12 @@ export const createNewPath = ({ return d3 .area() .x((d) => x(d.dateObj)) + .x0((d, index) => { + if (index === 0) { + return x(d.dateObj) - 2; + } + return x(d.dateObj); + }) .y0(svgHeight + 10) .y1((d) => y(d.y)); }