-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Line chart yAxis data interval #912
Comments
Seems like the range of the data changed, or the zoom, or maybe the size of the device you're testing? |
No, is the same data, same phone, same graph view size (no zoom) :S |
how about the formatter? You are using a percent style. the interval should not change at all. change to decimal style to see how the number is. |
@ergihervi for the space, There is a small algorithm calcuating the range in I wish you could debug this on your side in |
@liuxuan30 Thanks for your answer! I updated to swift 2.2 and the last 'Charts' update. I didn't set the extra top off set before, but it looks that I have to do it now in order to have a little space from the last yValue to the top (Just found how to do this). I printed the left axis entries, and this was the result: [0.0, 0.033846153846153845, 0.067692307692307691, 0.10153846153846154, 0.13538461538461538, 0.16923076923076924]. I guess the size of the number is the problem, this probably could be fixed in the algorithm that calculates this values by (maybe) formatting the value that is being added? e.g. "0.033846153846153845" to "0.03" |
not really, while calculating the number is the number, no need to round (even you round, there's still the same issue). It's the value formatter that causes this, as you see 0.0338 -> 3% and 0.067 -> 7%, 0.101-> 10%. You can write your own formatter to solve this. I'm going to close this, since it's releated to formatter. |
@danielgindi Actually, what you think we limit the decimals to some digits? Like adding a property to specify how many digits we want to keep? So we only keep them. e.g. if we specify maxDigits = 2, 0.0338 -> 0.03, 0.067 -> 0.06, we don't do round at all. just abandon the addtional portion directly. That looses accuracy but it's user's choice. |
Hi! I have a problem with the 'y' data interval. Before to update, the intervals where the same:
0+3 = 3
3+3 = 6
6+3 = 9
9+3 = 12
12+3 = 15
And now, the intervals are different:
![captura de pantalla 2016-04-02 a las 6 28 21 p m](https://cloud.githubusercontent.com/assets/14208368/14230209/f603ad2c-f90a-11e5-9df9-77144cd030c4.png)
0+3 = 3
3+4 = 7
7+3 = 10
10+4 = 14
14+3 = 17
Also, it used to have a little space between the last value and the top of the graph view.
How could I fix this? here is my code from the left axis:
let leftAxis = graphView.leftAxis
leftAxis.drawGridLinesEnabled = false
leftAxis.labelFont = UIFont.systemFontOfSize(10)
leftAxis.valueFormatter = yFormatter
leftAxis.forceLabelsEnabled = true
leftAxis.axisMinValue = 0
The text was updated successfully, but these errors were encountered: