https://codesandbox.io/s/synchronized-area-chart-forked-rv4ueb?file=/src/App.tsx
","upvoteCount":0,"url":"https://github.com/recharts/recharts/discussions/3529#discussioncomment-5647623"}}}-
|
Hi. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @LucieSumToZero Would be awesome if you could provide a codesandbox for this (template here https://codesandbox.io/s/synchronized-area-chart-forked-bofeq8). That way we can see how you have things set up and try to suggest some solutions. My understanding is that if the categories are not the same then there is no way for the chart to be synced. What is your expected result? |
Beta Was this translation helpful? Give feedback.
-
|
Hey @ckifer Thanks for your answer. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
Hi, when adding the solution to my area charts, it deactivates the tooltip viewbox (but not the cursor). Do you have some advice on how I could make sure to keep the tooltip view bow active? I have modified the 'syncMethodFunction' as below so that it can use the 'value' and 'category' of the data shown in the post on Apr 14, 2023: Thanks for your answer |
Beta Was this translation helpful? Give feedback.
Hi @LucieSumToZero ! Thanks for the example!
I think you could use
syncMethodto make it synchronized (do a little hack).2023-04-18.18.52.16.mov
It will calculate the nearby tick in data set 2 using the actived value in data set 1.
Core Code