-
-
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
Charts / Swift 3.0 - Fatal error: Index out of range #1749
Comments
where the error happens? for a wild guess, |
@liuxuan30 That's correct. You can see the attached screenshot where the values don't match up to sValues. I already checked to make sure each xValues count matches yValues count for each segment. |
If you insist on using |
I actually follow this suggestion - #1340 To follow up your comment, I searched around to figure out a solution to this issue. Still, I'm not sure what I need to do to fix this. Can you offer some suggestion? Apologize for any inconvenience. |
A fix i did was the following code hopefully it helps. `
} |
@tunds I think there is a little error in your workaround. It should be |
@tunds Plz do the following changes your code will work..Crash occurs when there is only one reading .... |
I have a segmentControl with time range (1D, 3M, 1Y, 5Y) to perform network call and fetch data from Yahoo. First, I had to add a method for my String values for x-axis with the following:
In my LineChartViewController, I have a delegate for the timeRange change to perform my networkCall:
Here is my create Line ChartView:
I have a Fatal Error - Index out of range when I moved from "3M" to "1Y". I checked the xValues count to match yValues for each time range. It appears the error arrived at that xAxisStringValueFormatter where yValues count does not match the xValues. Seems strange to me. Any idea what I did wrong?
The text was updated successfully, but these errors were encountered: