Skip to content

Commit

Permalink
fix: area chart showing artifact at the begging of the chart
Browse files Browse the repository at this point in the history
  • Loading branch information
WadhahEssam committed Nov 13, 2023
1 parent 7f99da1 commit 3fae75f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export const createNewPath = ({
return d3
.area<DataPoint & { dateObj: Date }>()
.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));
}
Expand Down

0 comments on commit 3fae75f

Please sign in to comment.