script src https cdnjs cloudflare com ajax libs plotly js 2 22 0 plotly min js script div id myDiv div script var trace1 type sankey orientation h node groups Quiz 1 Quiz 2 Quiz 3 Quiz 4 label 0 40 41 60 61 70 71 80 81 100 0 40 41 60 61 70 71 80 81 100 0 40 41 60 61 70 71 80 81 100 color red orange blue green green red orange blue green green red orange blue green green link source 0 1 2 3 4 5 6 7 8 9 target 6 6 7 8 8 11 11 12 14 14 value 3 1 1 2 1 3 1 1 2 4 5 var data trace1 var layout title text SANKEY Title font family Courier New monospace size 24 annotations text QUIZ 1 x 0 0 y 1 1 showarrow false font size 12 text QUIZ 2 x 0 5 y 1 1 showarrow false font size 12 text QUIZ 3 x 1 0 y 1 1 showarrow false font size 12 text QUIZ 4 x 1 5 y 1 1 showarrow false font size 12 width 600 Plotly newPlot myDiv data layout script script src https cdn anychart com releases v8 js anychart core min js script script src https cdn anychart com releases v8 js anychart sankey min js script div id container div script anychart onDocumentReady function creating the data var data from Google to Facebook weight 20000 from Google to Twitter weight 17000 from Google to YouTube weight 8000 from Google to Wikipedia weight 11000 from Bing to Facebook weight 7500 from Bing to Twitter weight 5000 from Bing to Wikipedia weight 4000 calling the Sankey function var sankey_chart anychart sankey data customizing the width of the nodes sankey_chart nodeWidth 20 setting the chart title sankey_chart title Simple Sankey Diagram Example customizing the vertical padding of the nodes sankey_chart nodePadding 20 setting the container id sankey_chart container container initiating drawing the Sankey diagram sankey_chart draw script
x 1 5 y 1 1 showarrow false font size 12 width 600 Plotly newPlot myDiv data layout script script src https cdn anychart com releases v8 js anychart core min js script script src https cdn anychart com releases v8 js anychart sankey min js script div id container div script anychart onDocumentReady function creating the data var data from Google to Facebook weight 20000 from Google to Twitter weight 17000 from Google to YouTube weight 8000 from Google to Wikipedia weight 11000 from Bing to Facebook weight 7500 from Bing to Twitter weight 5000 from Bing to Wikipedia weight 4000 calling the Sankey function var sankey_chart anychart sankey data customizing the width of the nodes sankey_chart nodeWidth 20 setting the chart title sankey_chart title Simple Sankey Diagram Example customizing the vertical padding of the nodes sankey_chart nodePadding 20 setting the container id sankey_chart container container initiating drawing the Sankey diagram sankey_chart draw script