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

X or Y axis interval of the labels #3547

Closed
sultan-arshi opened this issue Jul 5, 2018 · 4 comments
Closed

X or Y axis interval of the labels #3547

sultan-arshi opened this issue Jul 5, 2018 · 4 comments

Comments

@sultan-arshi
Copy link

As we know that charts library auto calculate the labels/values on X-Axis and Y-Axis according to the values we provide in array

I Want to know the interval it is using on x-axis and on y-asix

is it possible ?

and I also looking to set the interval

Charts Environment

Charts version/Branch/Commit Number: latest
Xcode version: 9.4
Swift version: 4
Platform(s) running Charts: IOS
macOS version running Xcode: hight Sarria

@sultan-arshi
Copy link
Author

sultan-arshi commented Jul 5, 2018

I am using

  • chartView.xAxis.granularityEnabled = true

  • chartView.notifyDataSetChanged()

  • let interval = chartView.xAxis.granularity

  • But unfortunately interval always is 1 I don't know why it is happening

@thierryH91200
Copy link
Contributor

the default value of granulatary is 1.0

    If granularity is enabled, then do not allow the interval to go below specified granularity.
   This is used to avoid repeated values when rounding values for display.

look at

YAxisRenderer : @objc open func computeAxisValues(min: Double, max: Double)

@sultan-arshi
Copy link
Author

sultan-arshi commented Jul 6, 2018

can you please explain it ?
I want to know the interval of the x-axis and y-axis
is it possible ?

@georgmay
Copy link

@sultan-arshi I'm pretty sure you need to set the actual xAxis.granularity value, as per documentation:

The minimum interval between axis values.
This can be used to avoid label duplicating when zooming in.

@jjatie jjatie closed this as completed Sep 17, 2018
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

4 participants