Change Sankey link color based on a datarow value?

332 views
Skip to first unread message

Shravan Kumar

unread,
Jul 30, 2015, 10:15:19 PM7/30/15
to Google Visualization API
So I have a Sankey diagram, I want the links to be either colored red or green or yellow.

But I want the coloring to based on a dataRow value.


Example: if DataRow status = Sever, then that link should be colored red
if status = Not an Issue, then that link should be colored green
else link should be yellow.

How can I incorporate this in my visualization?

Regards,
Shravan

Sergey Grabkovsky

unread,
Jul 31, 2015, 9:49:31 AM7/31/15
to Google Visualization API
Hi Shravan,

Your best bet is probably to use to the style role, and calculate the colors yourself. Here's a simple example: https://jsfiddle.net/samfazpz/

--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Shravan Kumar

unread,
Aug 3, 2015, 3:01:31 PM8/3/15
to Google Visualization API, gra...@google.com
Thank you very much, this works for my visulaization!!


On Friday, 31 July 2015 06:49:31 UTC-7, Sergey wrote:
Hi Shravan,

Your best bet is probably to use to the style role, and calculate the colors yourself. Here's a simple example: https://jsfiddle.net/samfazpz/

On Thu, Jul 30, 2015 at 10:15 PM Shravan Kumar <shrav...@gmail.com> wrote:
So I have a Sankey diagram, I want the links to be either colored red or green or yellow.

But I want the coloring to based on a dataRow value.


Example: if DataRow status = Sever, then that link should be colored red
if status = Not an Issue, then that link should be colored green
else link should be yellow.

How can I incorporate this in my visualization?

Regards,
Shravan

--
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 google-visualization-api+unsub...@googlegroups.com.

Shravan Kumar

unread,
Aug 4, 2015, 5:46:00 PM8/4/15
to google-visua...@googlegroups.com
Can I hyper link the Link between nodes in SAnkey?

I would like to redirect the user to a different page if they click the link between nodes... Is that possible?

Regards,
Shravan

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/UIkJy2R3uLk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Sergey Grabkovsky

unread,
Aug 5, 2015, 9:33:42 AM8/5/15
to google-visua...@googlegroups.com
It is possible, but there's not really any quick way to do this. You will have to listen for the 'select' event and open the link yourself via window.open or something.

Shravan J Kumar

unread,
Aug 5, 2015, 11:12:28 AM8/5/15
to google-visua...@googlegroups.com
But the select event does not work for Sankey. There is a bug submitted for the same.

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages