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] _yAxis.entries will not be cleaned up in computeAxisValues in radar chart #158

Closed
liuxuan30 opened this issue Jun 18, 2015 · 1 comment

Comments

@liuxuan30
Copy link
Member

I have seen this bug in radar chart, but not sure if applicable to other charts.

Due to the nature of adaptive calculating for the intervals,

var rawInterval = range / Double(labelCount);

will have different range, so sometimes, the actual n value in

            for (f = first; f <= last; f += interval)
            {
                ++n;
            }

will have different values. if we change the data, n can be 4 or 5. so the _yAxis.entries can be messed up.

For example,first time:

(lldb) po _yAxis.entries
[0.0, 400.0, 800.0, 1200.0]

when I change the data:

(lldb) po _yAxis.entries
[0.0, 100.0, 200.0, 300.0, 400.0, 500.0]

Seems good hah? But if I change the data back to the first one:

(lldb) po _yAxis.entries
[0.0, 400.0, 800.0, 1200.0, 400.0, 500.0]

The trick is the second data will have 6 elements, while the first only has 3. This will cause the _yAxis.axisRange to a wrong value, and chart.factor, and the rendering then.

I have fixed this in liuxuan30@48d0804

However, I don't know how to separate different commit to different pull request. GitHub just merged all my commits into one.

@liuxuan30 liuxuan30 changed the title bug:_yAxis.entries will not be cleaned up in computeAxisValues in radar chart [BUG] _yAxis.entries will not be cleaned up in computeAxisValues in radar chart Jun 18, 2015
@liuxuan30
Copy link
Member Author

close this as it has been merged

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

1 participant