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

Incorrect behavior for AxisBase.axisMaxLabels #3656

Closed
1 task done
UweMeier opened this issue Sep 19, 2018 · 1 comment
Closed
1 task done

Incorrect behavior for AxisBase.axisMaxLabels #3656

UweMeier opened this issue Sep 19, 2018 · 1 comment
Labels

Comments

@UweMeier
Copy link

What did you do?

chartView.rightAxis.axisMinLabels = 10
chartView.rightAxis.axisMaxLabels = 15

What did you expect to happen?

axisMinLabels to be 10
axisMaxLabels to be 15

What happened instead?

axisMinLabels == 15
axisMaxLabels == 15

Charts Environment

Charts version/Branch/Commit Number: 3.2.0
Xcode version: 10.0 (10A255)
Swift version: 4.2
Platform(s) running Charts: iOS 11

Solution

looks like axisMaxLabels' didSet has some erroneous code inside:

https://github.com/danielgindi/Charts/blob/5087a04bbefc9f15995113954ce217bbfb445577/Source/Charts/Components/AxisBase.swift#L222-L224

Shouldn't it be axisMaxLabels = axisMaxLabels > 0 ? axisMaxLabels : oldValue in Line 223?

@liuxuan30
Copy link
Member

Seems a bug. Would you mind a fix and file a PR?

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