You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep getting an 'index out of range' error in the getFormattedLabel() function.
The strange part is that it only occurs roughly around 5% of the time, and I cannot replicate it for the same set of data.
I retrieve and format JSON from a server and use the information to populate a lineChart.
I customize the xAxis using:
lineChart?.xAxis.valueFormatter = IndexAxisValueFormatter(values: years)
But for some reason this line produces an error every so often:
return valueFormatter?.stringForValue(entries[index], axis: self) ?? ""
I'm not sure how the index could be out of range when a conditional check is done in the lines prior:
if index < 0 || index >= entries.count
{
return ""
}
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
What's the trace log? This should be easy to know if you post the full stack. You also need to check if you touch you entries on the fly. We can say nothing from what you post.
Hi,
I keep getting an 'index out of range' error in the getFormattedLabel() function.
The strange part is that it only occurs roughly around 5% of the time, and I cannot replicate it for the same set of data.
I retrieve and format JSON from a server and use the information to populate a lineChart.
I customize the xAxis using:
lineChart?.xAxis.valueFormatter = IndexAxisValueFormatter(values: years)
But for some reason this line produces an error every so often:
return valueFormatter?.stringForValue(entries[index], axis: self) ?? ""
I'm not sure how the index could be out of range when a conditional check is done in the lines prior:
if index < 0 || index >= entries.count
{
return ""
}
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: