Skip to content

Inverted Y Axis #512

Closed Answered by Spookywooky3
Spookywooky3 asked this question in Q&A
Discussion options

You must be logged in to vote

Nevermind, was any easy fix I just had to educate myself on how domains work lol.
For anyone else who is looking for something similar.

<CartesianChart
      data={stops}
      xKey='x'
      yKeys={['y']}
      axisOptions={{ font }}
      domain={{
        y: [Math.max(...stops.map((stop) => stop.y)), 0],
      }}>
      {({ points }) => (
        <Line
          points={points.y}
          color='#188a8d'
          strokeWidth={2}
        />
      )}
</CartesianChart>

Replies: 1 comment

Comment options

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