Tooltip for Sankey diagram not working

455 views
Skip to first unread message

Alex Kirchberger

unread,
Jan 26, 2015, 11:52:39 PM1/26/15
to google-visua...@googlegroups.com
Hello!

I'm trying to make a sankey diagram here: http://www.eurchi.org/mipex-viz.html

I can load the chart fine, but the tooltip doesn't work. This is the code I use:

<html>
<head>
<script type="text/javascript"
 src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['sankey']}]}">
</script>

<div id="sankey_basic" style="width: 1200px; height: 600px;"></div>

<script type="text/javascript">
google.setOnLoadCallback(drawChart);

   function drawChart() {
   var data = new google.visualization.DataTable();
   data.addColumn('string', 'Country');
   data.addColumn('string', 'Stakeholder');
   data.addColumn('number', 'Weight');
   data.addRows([
     [ 'Austria', 'Press', 12 ],
     [ 'Austria', 'NGOs', 16 ],
     [ 'Austria', 'Academics', 32 ],
     [ 'Belgium', 'Press', 4 ],
     [ 'Belgium', 'NGOs', 3 ],
     [ 'Belgium', 'Academics', 5 ],
     [ 'France', 'Press', 23 ],
     [ 'France', 'NGOs', 4 ],
     [ 'France', 'Academics', 32 ],
     [ 'Germany', 'Press', 32 ],
     [ 'Germany', 'NGOs', 12 ],
     [ 'Germany', 'Academics', 34 ],
   ]);
   
   // Set chart options
   var options = {
     width: 1000,
     sankey: { node: { width: 40 } },
   };

    // Instantiate and draw our chart, passing in some options.
   var chart = new google.visualization.Sankey(document.getElementById('sankey_basic'));
   chart.draw(data, options);
  }
</script>
</head>
</html>

I tried to add a column for tooltips but apparently Sankey charts do not allow tooltip role columns.

Any idea of what I can do to get a tooltip?

Many thanks in advance for your help!

Alex

Stephen McGlade

unread,
Feb 18, 2015, 1:04:44 PM2/18/15
to google-visua...@googlegroups.com
I have exactly the same issue !

Daniel LaLiberte

unread,
Feb 18, 2015, 2:12:24 PM2/18/15
to google-visua...@googlegroups.com
Unfortunately, the Sankey chart does not yet support tooltips, despite the documentation saying it does.  No promises at this time for when we will get to it.

--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Isaac Wyatt

unread,
Feb 26, 2015, 9:43:53 PM2/26/15
to google-visua...@googlegroups.com
Sankey chart tool tips used to work - now they no longer do. Would be nice to have fixed. Great chart otherwise!
Reply all
Reply to author
Forward
0 new messages