Skip to content

BarStack hover effect #1592

Answered by Brookelyn
LoiKos asked this question in Q&A
Oct 26, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hey @LoiKos!

I'm sure you've already found a solution for this, but wanted to share an example of how I solved this in case it's helpful for anyone else: you can see everything in this CodeSandbox.

When passing data to your BarStack, it returns an array of barStacks. EachbarStack contains the info for a single series, which in this case can be found in barStack.bars. These data points will usually correspond to your original data, so the data at the 0 index in bars for a given series will match the values in data[0], which means you can use the index of a given bar to pass a selected index to your tooltipData, and then change the styling.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@LoiKos
Comment options

@Brookelyn
Comment options

@LoiKos
Comment options

@carleryd
Comment options

Answer selected by LoiKos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants