Skip to content
Discussion options

You must be logged in to vote

Well after a couple of hours of troubleshooting and some help from ChatGPT, the fix was to change the curve value to curveMonotoneX instead of curveNatural from the d3-shape library.

I'm not entirely sure why, but me graph is now ok.

So, based on the original example from the website, here's that needs to be change to fix the issue of overlapping lines:

  • import { curveNatural } from "d3-shape"; should be replaced to import { curveMonotoneX } from 'd3-shape';
  • In the area item of the chart props, replace curveNatural to curveMonotoneX

Here's the "fixed" code based on the example:

<script lang="ts">
  import TrendingUpIcon from "@lucide/svelte/icons/trending-up";
  import * as Chart from "$…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by regg00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant