-
-
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
Gap issues on latest version #804
Comments
Latest release has deprecated startAtZeroEnabled, which seems is your case.
I used ChartsDemo, and the 0-yaxis still at the bottom |
@liuxuan30 Yea startAtZeroEnabled but by default .customAxisMin = 0.0 anyway. Still getting that gap though |
@danielgindi This question has been asked twice (another is from SO:http://stackoverflow.com/questions/35798915/issue-in-display-of-barchart-with-latest-ioscharts) I debugged a little with ChartsDemo: double val = (double) (arc4random_uniform(mult));
if (i == 0)
[yVals addObject:[[BarChartDataEntry alloc] initWithValue:1 xIndex:i]];
else
[yVals addObject:[[BarChartDataEntry alloc] initWithValue:val xIndex:i]]; and in calcMinMax line 337: // Use the values as they are
_leftAxis.axisMinimum = !isnan(_leftAxis.customAxisMin)
? _leftAxis.customAxisMin
: (minLeft - bottomSpaceLeft) at this moment, my minLeft is 1.0, while bottomSpaceLeft is 3.5 (35 * 0.1), so the axisMinimum < 0, and we see the additional space. |
@acegreen could you specificly call
on left or right axis? (if you are using both, call on each axis) |
Its always nice to link to a SO question where the only answer is
I also already tried to specify leftAxis.customAxisMin = 0.0 and leftAxis.startAtZeroEnabled = YES with no effect. My data sets are on the xAxis in my case so it also make sense that the left or right axis are irrelevant |
hmm, could you try add break point, and print out minLeft, bottomSpaceLeft, and _leftAxis.axisMinimum
I think |
I'm confused! Just a side note: None of my data points are less than 0.0 |
I see you have 3 zero values, while I don't, so I manually insert zero values to see if there is bug. In my first test, I only have values >= 1 Anyway, I need your help to print out minLeft, bottomSpaceLeft, and _leftAxis.axisMinimum, I think it should not happen if you called leftAxis.customAxisMin = 0.0 |
Side note #2: If I leave all my entries at 0, the labels are shifted to the middle of the chart. |
@acegreen yeah, I just want to simulate your data sets in ChartsDemo. that's why I said |
can we have a live chat? you only use left axis? your _leftAxis.axisMinimum seems fine... |
try http://chat.stackoverflow.com/rooms/105523/ios-charts-issue-804, I create a room |
So during the chat, it turned out that @acegreen is setting data first, after that is setting the chart without calling notifyDataSetChanged(). reversing the order and problem solved. Le't get back to the table @danielgindi |
@liuxuan30 Appreciate the effort on this one. I would force axisMinimum to 0. its an unnecessary step and most users will want to start at 0. Those that are looking for negative will need to implement that customAxisMin |
@acegreen we still need to discuss the default behavior with @danielgindi , I will manage this issue, thanks |
@liuxuan30 sure. I have my 2 cents above. Unsubscribing to let you guys discuss |
Actually, |
@acegreen Can you help me with my values? How did you make your values without .00 (for example 23.00 now showing as 23)??? Thank you very much! |
@st-small check out |
Hello,
I'll start off by saving, great work on this library, I have been using it for a while now with no issues. I came across something interesting with the new update.
As I recall, this gap was not present before. You can see in the image below, there is a gap between the bars and the bottom line
The text was updated successfully, but these errors were encountered: