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

[feature request] support fixed yAxis interval and xAxis labelCount #155

Closed
liuxuan30 opened this issue Jun 17, 2015 · 6 comments
Closed

Comments

@liuxuan30
Copy link
Member

Setting yAxis.labelCount will not always get the same count. For example radar chart, if I set the yAxis.labelCount to be 3, I may get 5 label displayed. This is caused by computeAxisValues(min yMin: Double, max yMax: Double) has some logic to compute the intervals. This is sometimes confusing since I want to the final labelCount to be same as what I set.

Adaptive compue is a very good design, but sometimes people just want that smart. Supporting fixed labelCount for both xAxis and yAxis gives another choice.

@liuxuan30 liuxuan30 changed the title [feature request] support fixed yAxis interval [feature request] support fixed yAxis interval and xAxis labelCount Jun 17, 2015
@danielgindi
Copy link
Collaborator

I actually do not completely understand the requirement...

@liuxuan30
Copy link
Member Author

At first, I thought setting yAxis.labelCount will lead to setting the 'interval' on yAxis. Take an example,

If I set yAxis.labelCount = 3, and the yMax value is 5, I hope there are only 3 labels on the yAxis, like [0,3,6] as the labels. If I set to 6, may be [0,1,2,3,4,5].

However, it turned out that setting yAxis.labelCount will not always get the same count as we want. It will have +1/-1 deviation.

computeAxisValues(min yMin: Double, max yMax: Double) will calculate how many values.

What I want is a 'fixed' count. Setting yAxis.labelCount but results in another count of labels displayed is kind of confusing.

@danielgindi
Copy link
Collaborator

Well for obvious reasons this number cannot be fixed, and only be approximated. Like any other such calculation... It is also, btw, specified in the docs :-)

@danielgindi
Copy link
Collaborator

/// the number of label entries the y-axis should have
/// max = 25,
/// min = 2,
/// default = 6,
/// be aware that this number is not fixed and can only be approximated

@carrchr
Copy link

carrchr commented Sep 30, 2015

I'm not very good with Swift, yet, otherwise I would try tackling it myself. Have you looked at MPAndroidChart feature: Added feature that allows the label-count to be exactly set and evenl...
Will this be possible in ios-charts?

@danielgindi
Copy link
Collaborator

It exists already edd9c2e

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

3 participants