-
-
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
ios-charts different plotting activity than MKAndroidChart #276
Comments
First of all, your data seems not the same, android data range is like [70K, 110K], but iOS version is like [90K,110K] Another is its origin point is higher than android. Double check your chart view's frame on iOS. |
@liuxuan30 the data I am pulling matches what is in Android (70K, 110K). |
It should never be the case that if you feed the data in range [70K,110K] and it draws at the wrong position like [90K,110K], at least not on my side... It's a serious bug and I just cannot believe it right now. You might need to provide the dataSet code and we can try. For the frame, you can check and compare before/after the autolayout engine calculate the frame. I would suggest start from debugging the frame. What you can try is after the autolayout engine finalized the frame, you start creating the dataSet and feed the chart. I just take a look at the ChartsDemo, and it also uses autolayout. Seems putting the code in viewDidLoad is also fine. Anyway, you have to debug it more |
To me it seems that your problem is the |
You may also want to check if your auto-layout constraints stick to margins or not. Because those "margins" can confuse and cause you to add extra spacing - or have negative extra spacing. |
The NumberFormatter for the Y Axis is a separate issue. I'll check the |
@nlabhart I also guess it's autolayout problem, yesterday I met one. Configuring chart view in viewDidLoad and viewDidAppear has slight difference. The one in viewDidAppear is not correct. But it's not my code, so I have to wait for other people to fix. |
Xuan - is there a function similar to the invalidate() function on |
setNeedsDisplay IS invalidate() בתאריך יום חמישי, 6 באוגוסט 2015, Noah Labhart notifications@github.com
|
That is good to know! What I have found out is that changing the option setZeroEnabled for the |
Yes it is. In most functions that work on the data, the chart can't know בתאריך יום חמישי, 6 באוגוסט 2015, Noah Labhart notifications@github.com
|
Figured it out, without setNeedsDisplay or notifyDataHasChanged. There are two Y axis's in the LineChart I am using - leftAxis and Thanks for the help! |
Have you set your dataSet.axisDependency accordingly? By default it's left. but if you disable leftAxis and enable rightAxis, it should render wrongly I think. startAtZeroEnabled will only affect how the axis range is calculated. if you only have positive data, it's ok to leave it as 'YES' on both axis. BTW, be careful it you have negative values and disabled startAtZeroEnabled, because I think current calcuation for axis range has bug when dealing with small negative values. Check #166, PR #207, though it's for radar chart. They share the same axis range calcuation in |
Hi @danielgindi would it be possible for you to remove my email address references from your comments? :) |
Please see the attached screenshots for a visual of what is happening. The data set is coming back the from the same source, and is the same data. The data is plotting correctly on the Android implementation (MKAndroidChart), but is not plotting correctly using ios-charts. Is there an obviously setting or view property that I did not set? If you need to see code, I can certainly post it.
ANDROID (Correct Version)
![android](https://cloud.githubusercontent.com/assets/3129166/9077550/1bcc6d16-3af5-11e5-9262-af7ad73e4f3e.png)
IOS (Incorrect plotting)
![ios](https://cloud.githubusercontent.com/assets/3129166/9077551/1bdf80d6-3af5-11e5-9c3e-105681e27d52.PNG)
The text was updated successfully, but these errors were encountered: