Skip to content

Multiple YAxes #3041

Answered by MattyKems87
memee asked this question in Q&A
Discussion options

You must be logged in to vote

Have you specified the yAxisId prop for your YAxes and your two cartesian graph components? Not sure if that makes a difference as I'm also new to recharts, but you give it a try. Give both your YAxes a yAxisId and set the same yAxisId on the corresponding cartesian components. Here's a composite chart I've set up using some samples which has two y axes:

const data = [
  {
    name: "Jan",
    uv: 590,
    pv: 800,
    amt: 1400,
    cnt: 490
  },
  {
    name: "Feb",
    uv: 868,
    pv: 967,
    amt: 1506,
    cnt: 590
  },
  {
    name: "March",
    uv: 1397,
    pv: 1098,
    amt: 989,
    cnt: 350
  },
  {
    name: "April",
    uv: 1480,
    pv: 1200,
    amt: 1228,
    cnt: 480
  }…

Replies: 1 comment

Comment options

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