Dear Gabriel, You can create Sankey diagram directly in Google Sheets with data visualization add-on.
ChartExpo™ can create 50+ custom charts from few clicks without coding. You can export chart code or diagram in any format. Installation Source: Google Sheets Add-on: https://chartexpo.com/utmAction/MTErY29tbXVuaXR5K2dzK1NCK0dHKw== Thanks! On Saturday, March 27, 2021 at 7:49:19 PM UTC+5 [email protected] wrote: > I want to use a Sankey's Diagram that I configured in *jsfiddle* in a > google sheet. But it is not working, dont know for sure why. > > This is what I'm typing in: > > google.charts.load('current', {'packages':['sankey']}); > google.charts.setOnLoadCallback(drawChart); > > function drawChart() { > var data = new google.visualization.DataTable(); > data.addColumn('string', 'From'); > data.addColumn('string', 'To'); > data.addColumn('number', 'Weight'); > data.addRows([ > [ 'Intenções', 'Intenções Aprovadas', 483 ], > [ 'Intenções', 'Reprovados SERASA', 422], > [ 'Reprovados SERASA', 'Assinadas', 0.1], > [ 'Intenções Aprovadas', 'Canceladas', 248 ], > [ 'Intenções Aprovadas', 'Assinadas', 235 ], > [ 'Canceladas', 'Instaladas', 0.1 ], > [ 'Assinadas', 'Quebras', 25 ], > [ 'Assinadas', 'Instaladas', 210 ], > ]); > > var colors = ['#b2df8a', '#b2df8a', '#FBAEAE', '#b2df8a', > '#FBAEAE', '#b2df8a', '#FBAEAE' ]; > > > // Sets chart options. > var options = { > width: 800, > sankey: { > node: { colors: colors, nodePadding: 10, width:50 }, > link: { colorMode: 'gradient', colors: colors} > } > }; > > // Instantiates and draws our chart, passing in some options. > var chart = new > google.visualization.Sankey(document.getElementById('sankey_basic')); > chart.draw(data, options); > } > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/2984502a-ab2a-4fb0-bc11-c606dda195b9n%40googlegroups.com.
