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

On Y Axis "0" may be displayed as "-0" #1008

Closed
manuelneves opened this issue May 4, 2016 · 2 comments
Closed

On Y Axis "0" may be displayed as "-0" #1008

manuelneves opened this issue May 4, 2016 · 2 comments

Comments

@manuelneves
Copy link

manuelneves commented May 4, 2016

ChartYAxisRenderer.swift

f may be -0 sometimes.
let first = ceil(Double(yMin) / interval) * interval

(lldb) p yMin
(Double) $R1 = -531.21598815917969
(lldb) p interval
(Double) $R2 = 3000
(lldb) p Double(yMin) / interval
(Double) $R3 = -0.1770719960530599
(lldb) p ceil(Double(yMin) / interval)
(Double) $R4 = -0
(lldb) p first
(Double) $R5 = -0

This can be fixed like this:
for (f = first, i = 0; i < n; f += interval, ++i)
{
if (f == 0) { // make sure that 0 is always positive (f could be -0)
f = 0;
}

            _yAxis.entries[i] = Double(f)
        }
@liuxuan30
Copy link
Member

liuxuan30 commented May 5, 2016

I remember it has been fixed for a long time. which version are you using, and which renderer you are refering?

@manuelneves
Copy link
Author

You are right. I can see that you put in the same fix i suggested.
We were using an older version.
Thanks!

On 05 May 2016, at 03:52, Xuan notifications@github.com wrote:

I remember it has been fixed a long time. which version are you using?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #1008 (comment)

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