chartEvents not working/fired for Sankey Diagram
See original GitHub issueBased on Listening to chart events example, I was trying to implement the same for Sankey Diagram. But the callback event is never fired. I wonder if there is any other way for callback on select of a particular node in Sankey diagram? Below is the code that I am using:
import React, { Component } from 'react'
import Chart from 'react-google-charts'
const data = [
["From", "To", "Weight"],
["A", "X", 5],
["A", "Y", 7],
["A", "Z", 6],
["B", "X", 2],
["B", "Y", 9],
["B", "Z", 4]
];
const options = {};
const chartEvents = [
{
eventName: "select",
callback(chartWrapper) {
console.log("Selected ", chartWrapper.getChart().getSelection());
}
}
];
class SankeyChart extends Component {
render() {
return(
<div style={{padding: 10}}>
<Chart
chartType="Sankey"
width="600px"
height="200px"
data={data}
chartEvents={chartEvents}
/>
</div>
)
}
}
export default SankeyChart
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
chartEvents not working in react-google-charts's sankey ...
I tried codesandbox with this issue and console.log() didn't appear when React.StrictMode is selected. It didn't happen with other graph ...
Read more >Sankey chart shows 'no data found' error
While analyzing flow telemetry, adding filters and/or facets to the sankey diagram results in an error that no data could be found. Sankey...
Read more >sankey diagram not working - Microsoft Power BI Community
I am trying to create a sankey diagram with very simple data. I get a blank box with a title. Suggestions for getting...
Read more >4 use-cases for Sankey Charts - Towards Data Science
So here I would like to state the use-cases where Sankey charts makes sense. Analysing flow. When Sankey diagram originated in 1898, its...
Read more >Sankey Diagram | Charts - Google Developers
Note: Avoid cycles in your data: if A links to itself, or links to B which links to C which links to A,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@PhaniKumarAdiraju Glad to hear that it worked partially. I’ve created a sandbox for you to check out. I think this will answer your questions! https://codesandbox.io/s/rw34j2ywy4
Cheers!
@PhaniKumarAdiraju I created a pull request to fix the sample, which might be related to your situation. Would this fix your events not firing? https://github.com/rakannimer/react-google-charts/pull/250