anychart.onDocumentReady(function () {
{from: "Canada", to: "France", weight: 2230000},
{from: "Canada", to: "Germany", weight: 1990000},
{from: "Canada", to: "Italy", weight: 1180000},
{from: "Canada", to: "Spain", weight: 990000},
{from: "USA", to: "France", weight: 950000},
{from: "USA", to: "Germany", weight: 2020000},
{from: "USA", to: "Spain", weight: 1110000}
var chart = anychart.sankey(data);
chart.title("Sankey Diagram: Basic Sample");
chart.container("container");
chart.listen('click', function(e) {
if (e.domTarget.tag && e.domTarget.tag.element) {
var el = e.domTarget.tag.element;
var type = el.type ? 'flow' : 'node';
console.log(`Node on level ${level} with name ${name}`);
console.log('Flow was clicked');