Clickable/Linkable Ticks #219
Answered
by
rokotyan
errantmind
asked this question in
Q&A
-
Hello, I have a stacked horizontal bar chart showing some metrics for different 'sites', which are along the y-axis (the ticks). I'd like to make those sites clickable to go to particular pages, or maybe trigger a custom 'on click' event. Is this possible? |
Beta Was this translation helpful? Give feedback.
Answered by
rokotyan
Jun 2, 2023
Replies: 1 comment 4 replies
-
@errantmind You can set up events for Axis components just like for any other component. Here's how to do it for a click event: import { VisAxis, ... } from '@unovis/react'
import { Axis } from '@unovis/ts'
...
<VisAxis
...
events={{
[Axis.selectors.tick]: {
click: (tickValue: number) => console.log(tickValue),
},
}}
/> |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
errantmind
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@errantmind You can set up events for Axis components just like for any other component. Here's how to do it for a click event: