Skip to content

How to use DataProvider to sync charts with different yScale domains? #1646

Answered by williaster
MarkLyck asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @MarkLyck thanks for checking out visx! I'm excited someone is using these advanced features, we use them internally and they can be quite powerful. (Thanks also for noting the linked tooltip example is broken, I just updated it 🙏 )

Here's an updated version of it where each chart has independent data – this probably should be the example we use in the docs actually. https://codesandbox.io/s/linked-tooltips-independent-data-vvesr0?file=/Example.tsx

The key difference is that the charts only have a shared EventEmitterProvider – not a shared DataProvider. The DataProvider handles collecting all the data from child series and computing scales, which means that if charts share this they …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MarkLyck
Comment options

Answer selected by MarkLyck
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