-
Notifications
You must be signed in to change notification settings - Fork 95
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
How to add custom behaviour on click event of any slice of sunburst component in react? #94
Comments
Sorry, I just realized that we have to add the methods to
Now clicking on slices zooms in as desired. However, it does not seem to invoke the And when I we omit It will be of great help to find one working example of react-capsule + sunburst-chart with click event handler. |
@RajS999 thanks for reaching out.
The real issue is that by defining onClick={node => {
myChartRef.current.focusOnNode(node);
// add your custom onClick functionality here
}} This assumes |
@vasturiano I am trying to use the sunburst using useEffect hook and on adding onClick function it shows myChartRef.current.focusOnNode(node) is not a function |
I am still witnessing myChartRef.current.focusOnNode(node) is not a function error. if Possible, Can anyone pls share sample code for using in react with react kapsule and forward ref. Just the syntax would do Thanks. |
When sunburst component is used in react built with
react-kapsule
, how can I add custom behaviour on click event of any slice of sunburst.From suggestion here, I tried something like this:
The problem I faced is that
myChart
is undefined inside theonClick
handler of react component. So, this givesmyChart is not defined
error and the chart does not perform the default zooming behavior. If I omit the first line, "clicked" gets printed to the console.Link to the errored line is the codesandbox.
The text was updated successfully, but these errors were encountered: