Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronized graph do not synchronize on XAxis range move #2479

Open
1 task done
raomin opened this issue Mar 5, 2021 · 7 comments
Open
1 task done

Synchronized graph do not synchronize on XAxis range move #2479

raomin opened this issue Mar 5, 2021 · 7 comments
Labels
bug General bug label

Comments

@raomin
Copy link

raomin commented Mar 5, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://recharts.org/en-US/examples/SynchronizedLineChart

Steps to reproduce

  1. Zoom to the end: Move left brush handle to the right to only display Page E, Page F, Page G. All graphs are synchronized and display the same xaxis
  2. Drag the brush to the left to display Page A, Page B, Page C.

What is expected?

I would expect that the 3 graphs displays the same part of the XAxis

What is actually happening?

Only the graph with the brush display the expected range of XAxis. The other graphs remain with the XAxis range on Page E, Page F, Page G.

Environment Info
Recharts v2.0.8
React 17.0.1
System nodejs 6.14.11
Browser Chrome 86.0.4240

image

@StR1nG7
Copy link

StR1nG7 commented Sep 10, 2021

I noticed in my local project, if remove Tooltip component from graph with Brush inside, Brush will works correctly. But in this case (without Tooltip), we will have not synchronized tooltips - if hover graph with brush, tooltips will not appear in this and other graphs.

@natBizitza
Copy link

I noticed in my local project, if remove Tooltip component from graph with Brush inside, Brush will works correctly. But in this case (without Tooltip), we will have not synchronized tooltips - if hover graph with brush, tooltips will not appear in this and other graphs.

Is it still the only solution?

@natBizitza
Copy link

natBizitza commented Apr 28, 2022

Until it's solved in the library, you can avoid the issue by wrapping the brush in another chart and setting the same syncId to it.

BTW, this demo helped me!

@inkinkz
Copy link

inkinkz commented May 10, 2022

Until it's solved in the library, you can avoid the issue by wrapping the brush in another chart and setting the same syncId to it.

BTW, this demo helped me!

omg, thank you

@tfc
Copy link

tfc commented Oct 4, 2022

@natBizitza thank you, this is a very elegant workaround. 🙏

Is anything done on this? The bug seems to be more than a year old.

@ckifer ckifer added the bug General bug label label Jan 2, 2023
@Kwonkunkun
Copy link

Until it's solved in the library, you can avoid the issue by wrapping the brush in another chart and setting the same syncId to it.

BTW, this demo helped me!

good solution!! thank you

but, it is weird that not fix immediatly the bug. I think this bug is critical..

@otudosa
Copy link

otudosa commented Oct 18, 2023

By default syncMethod uses the index to synchronize the charts, that's why when you use the brush to zoom in, you get different categories displayed. In order to be able to get the same category, even when you use the brush, you need to set syncMethod to value.
You can read more about it in the docs https://recharts.org/en-US/api#syncMethod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug General bug label
Projects
None yet
Development

No branches or pull requests

8 participants