Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding measure as sum #6

Open
Metti1371 opened this issue Sep 4, 2018 · 2 comments
Open

Adding measure as sum #6

Metti1371 opened this issue Sep 4, 2018 · 2 comments

Comments

@Metti1371
Copy link

Hi Jonathan,
Thank you so much for the cool sankey but unfortunately I have an issue with measure.
I have attached an excel file in case if you would like to replicate. I include "Year 1" and "Year 2" as dimensions and "Sum(percentage)" as measure but nothing shows up. If I use count instead of sum, I can see the sanki but I need to show the sum.
I am looking to hear from you.
Best,
Metti
PF.xlsx

@jonvitale
Copy link
Owner

Mohammadreza,

The problem here is that - according to my understanding - Sankey charts are typically used to show counts of things - e..g, how many went from A to B in year 1 to year 2. So, in the code there is a minimum node count of 1, saying that we don't show any node unless there is 1 (person, company, thing) represented.

This issue also came up at work, where someone wanted to show what percent moved from once class to another. Here's a quick workaround: in your load script multiply your Percentage field by 100. So, instead of 0.25 you'll have 25.

That may be good enough for you for now, but I'll also try updating the code to allow for percents as node values.

@Metti1371
Copy link
Author

Thanks Jonathan for quick reply. I was also wondering if it is possible to add data label into the sankey? Is it possible to add?
Best,
Metti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants