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

Negative values are not handled correctly #31

Closed
liezlsantos opened this issue Apr 12, 2019 · 2 comments
Closed

Negative values are not handled correctly #31

liezlsantos opened this issue Apr 12, 2019 · 2 comments

Comments

@liezlsantos
Copy link

When you have negative values in the dataset, the percentage is computed without using the absolute value of the data:

IMO, this wrong and the values are not represented correctly:
before-stacked-100-min0

After adjusting min and max of the x-axis to -100 and 200, respectively (so we can see all the bars):
before-stacked-100

Suggestion:
Compute the percentage using absolute value of the data (for reference this is also how it is done in MS Excel):
after-stacked-100

I submitted a pull request.

@liezlsantos liezlsantos changed the title Negative values are not rendered correctly Negative values are not handled correctly Apr 12, 2019
@y-takey
Copy link
Owner

y-takey commented Apr 15, 2019

Hi @liezlsantos , sorry for the delay.
Thanks for your issue and nice suggestion. :) I agree your idea completely. so, merged PR #30 and published a newer npm module(v0.7.1).

thank you very much!

@liezlsantos
Copy link
Author

Awesome! Thanks, @y-takey.

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