With the new 4.0 update in iOS Charts, I have redone all of my charts, including changing a lot of them to CombinedChartViews. however, now I am running into a very weird issue with accessing the entries using the in-built functions.
The data is presenting fine, as expected, but when highlighting, only some of the values are selecting. These are the same values that are only accessible through functions such as getEntryByTouchPoint.
guard let valOrig = self.getEntryByTouchPoint(point: location) else { return }
guard let val = lineBaseSet?.entries.getItemAt(Int(valOrig.x)) else { return }
print(val.x)
Only works for 40, 60, etc.
When I print lineData.first.entries, I get the correct count of 79 and all the entries are correct and in order. It's just when I am not accessing the array directly it can't seem to find most of the entries.
Entries working perfectly = 40, 60, 70, 75, 78, 79.
All others are not working.
This order of numbers seems to be exponential but I still don't see how this relates to the way it's not working.
I have only tested this on a CombinedChartView so not sure if it's working on other types.
Any help would be appreciated!!
EDIT: Sorry, bit of context, location is the location of a touch point, lineBaseSet is a custom variable equal to lineData?.first, and getItemAt() is the same as array[index] but it returns an optional as opposed to fatally crashing if out of index.