rajii

Untitled

Sep 20th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  4. <script type="text/javascript">
  5. google.charts.load('current', {'packages':['sankey']});
  6. google.charts.setOnLoadCallback(drawChart);
  7.  
  8. function drawChart() {
  9. var data = new google.visualization.DataTable();
  10. data.addColumn('string', 'From');
  11. data.addColumn('string', 'To');
  12. data.addColumn('number', 'Weight');
  13. data.addRows([
  14. [ 'A', 'X', 5 ],
  15. [ 'A', 'Y', 7 ],
  16. [ 'A', 'Z', 6 ],
  17. [ 'B', 'X', 2 ],
  18. [ 'B', 'Y', 9 ],
  19. [ 'B', 'Z', 4 ]
  20. ]);
  21.  
  22. // Sets chart options.
  23. var options = {
  24. width: 600,
  25. };
  26.  
  27. // Instantiates and draws our chart, passing in some options.
  28. var chart = new google.visualization.Sankey(document.getElementById('sankey_basic'));
  29. chart.draw(data, options);
  30. }
  31.  
  32.  
  33. </script>
  34. </head>
  35. <body>
  36. <div id="sankey_basic" style="width: 900px; height: 300px;"></div>
  37. </body>
  38. </html>
Add Comment
Please, Sign In to add comment