anychart.onDocumentReady(function () {
{from: "First Class", to: "Child", value: 6},
{from: "Second Class", to: "Child", value: 24},
{from: "Third Class", to: "Child", value: 79},
{from: "Crew", to: "Child", value: 0},
{from: "First Class", to: "Adult", value: 319},
{from: "Second Class", to: "Adult", value: 261},
{from: "Third Class", to: "Adult", value: 627},
{from: "Crew", to: "Adult", value: 885},
{from: "Child", to: "Female", value: 45},
{from: "Child", to: "Male", value: 64},
{from: "Adult", to: "Female", value: 425},
{from: "Adult", to: "Male", value: 1667},
{from: "Female", to: "Survived", value: 344},
{from: "Female", to: "Perished", value: 126},
{from: "Male", to: "Survived", value: 367},
{from: "Male", to: "Perished", value: 1364}
let chart = anychart.sankey();
chart.node().normal().labels().fontSize(14);
chart.node().labels().useHtml(true);
.format("<span style='font-weight:bold'>{%name}</span><br>{%value}");
return anychart.color.lighten(this.sourceColor, 0.5) + " " + 0.3;
return this.sourceColor + " " + 0.8;
'<span style = "color: #2b2b2b; font-size:20px;">Titanic Survivors</span>' +
'<br/><span style="color:#00bfa5; font-size: 16px;">(by gender, age, ticket class)</span>'
chart.container("container");