Hi William, Your idea of specifying the data with the v and f properties should work, but this chart was not implemented with that in mind. This is a bug which should not be difficult to fix. There is no alternative at this time, sorry.
On Mon, Dec 9, 2019 at 9:12 AM William <[email protected]> wrote: > I am trying to create a simple Sankey diagram showing flows between two > sets of nodes, and would like the two sets to have the same names. However, > this isn't allowed (it brings up a "Cycle found in rows" error), so I add > "2" to the names of the nodes in the second set, like so: > > function drawChart() { > var data = new google.visualization.DataTable(); > data.addColumn('string', 'From'); > data.addColumn('string', 'To'); > data.addColumn('number'); > data.addRows([ > ['foo', 'foo2', 6], > ['bar', 'bar2', 4], > ['foo', 'bar2', 6], > ['bar', 'foo2', 4] > ]); > > var chart = new > google.visualization.Sankey(document.getElementById('sankey_basic')); > chart.draw(data); > } > > However, I don't want the node labels to say "foo2" and "bar2" -- I just > want them to say "foo" and "bar". In some cases in Google Visualization API > you can solve this problem with {v: 'foo2', f: 'foo'} and {v: 'bar2', f: > 'bar'}, but that doesn't work here. Is there any way I can do this? > > -- > 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/0396c28a-e895-493e-b56b-87ad7fdd19cd%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/0396c28a-e895-493e-b56b-87ad7fdd19cd%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> Cambridge MA -- 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/CAOtcSJOhJNtSsvJxXvHmENsnVzh2LOrp4YBbzaD2WF%3DKuqjKxA%40mail.gmail.com.
