Hi! I'm following the developer guide
at
https://developers.google.com/chart/interactive/docs/customizing_tooltip_content#full.
I get 'Sankey chart.html:66 Uncaught (in promise) TypeError:
chart.setAction is not a function' error in the browser console for the
following implementation.
I'm wondering what do I wrong?
<script type="text/javascript">
google.charts.load("current", {packages:['sankey', 'wordtree']});
google.charts.setOnLoadCallback(drawSankeyChart);
function drawSankeyChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'From');
data.addColumn('string', 'To');
data.addColumn('number', 'Weight');
data.addRows([
...
]);
// Set chart options
var options = {
width: 1000,
tooltip: {
trigger: 'selection'
}
};
var chart = new
google.visualization.Sankey(document.getElementById('sankey_multiple'));
chart.setAction({
id: 'remove',
text: 'Remove',
action: function() {
selection = chart.getSelection();
alert(selection[0].row + 'will be removed');
}
});
chart.draw(data, options);
};
...
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/c450d22b-b9b5-4e1c-986c-344f2218be51n%40googlegroups.com.