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

Bug: red lines and area with positive values #26

Closed
aalfath opened this issue Jul 6, 2016 · 6 comments
Closed

Bug: red lines and area with positive values #26

aalfath opened this issue Jul 6, 2016 · 6 comments
Labels

Comments

@aalfath
Copy link

aalfath commented Jul 6, 2016

Hello,

Thanks for creating this library!

I'm not sure if this one is a bug or not, but I tried to create a chart from the example chart with y-min and y-max and I'm not sure if the chart generates correctly.

image

There are some red lines and area with certainly positive values in its data.
Is this a normal behavior?

I tried to check the value of the series and it does indeed positive (more than 0)

Any help would be appreciated!

@aalfath aalfath changed the title Bug in minY minX Bug in chart with minY and maxY enabled Jul 6, 2016
@gpbl
Copy link
Owner

gpbl commented Jul 6, 2016

Ho @aalfath indeed it seems a bug. Could you share the data you are using for the series, so that I can replicate it? Thanks!

@aalfath aalfath changed the title Bug in chart with minY and maxY enabled Bug: red lines and area with positive values Jul 6, 2016
@aalfath
Copy link
Author

aalfath commented Jul 6, 2016

Hi @gpbl, kindly used below data:

let data: Array<Float> = [0.0,  -2.70548,  -2.63699,  3.09075,  -3.05268, 0.0, 4.44349, 1.0, 0.0, -1.30397, 0.0, 0.0, 1.64384, -3.17637, 4.92295, -1.89212, -3.44178, -4.09326, 0.0, 2.06336, -2.5, 2.74829, -4.8532, 1.4726, -2.32021, 0.0, 0.0, -4.375, 4.10663, -0.821326, -1.77233, 1.73801]

Also, I can confirm that the bug would still appear even when minY and maxY is not defined. I have edited the title to avoid misunderstanding

@gpbl gpbl added the bug label Jul 6, 2016
@gpbl
Copy link
Owner

gpbl commented Jul 6, 2016

I can replicate this behavior even with

let data: Array<Float> = [0, -2, -2, 3, -3, 4, 1, 0, -1]

It seems the zero is giving problems when calculating positive/negative lines. Fix is coming, thanks for finding this bug!

(note to myself: this line should check <= 0 not just < 0.)

gpbl added a commit that referenced this issue Jul 6, 2016
@gpbl gpbl closed this as completed in 336ce2b Jul 6, 2016
@gpbl
Copy link
Owner

gpbl commented Jul 6, 2016

You can download the fixed release from https://github.com/gpbl/SwiftChart/releases/tag/v0.2.2, releasing on cocoapod soon once I remember how it works 📦 😛

@aalfath
Copy link
Author

aalfath commented Jul 6, 2016

Thank you for the quick fix, much appreciated! 😃 👍

@gpbl
Copy link
Owner

gpbl commented Jul 6, 2016

You are welcome! please reopen if needed (couldn't test the fix heavily).

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

No branches or pull requests

2 participants