Sankey: setAction is not a function

Skip to first unread message

Gyula Kósa

Jun 17, 2021, 8:50:43 AMJun 17
to Google Visualization API
Hi! I'm following the developer guide at

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']});

        function drawSankeyChart() {
          var data = new google.visualization.DataTable();
          data.addColumn('string', 'From');
          data.addColumn('string', 'To');
          data.addColumn('number', 'Weight');
          // Set chart options
          var options = {
            width: 1000,
            tooltip: {
                trigger: 'selection'
          var chart = new google.visualization.Sankey(document.getElementById('sankey_multiple'));
                id: 'remove',
                text: 'Remove',
                action: function() {
                    selection = chart.getSelection();
                    alert(selection[0].row + 'will be removed');

            chart.draw(data, options);

Charles Friedo

Jun 29, 2021, 7:10:59 AMJun 29
to Google Visualization API

You can create Sankey chart without coding in Google Sheets and Excel.

ChartExpo™ is a data visualization tool with 50+ custom chart types.

You can make charts with few clicks..
Sharing video on How to create Sankey diagram

Installation Sources:

Reply all
Reply to author
0 new messages