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
We've been seeing A LOT of crashes reported in LineChartRenderer.drawHighlighted.
What did you expect to happen?
No crashes
What happened instead?
It crashes. We've finally got a stack trace that is the probable cause (invalid index in getting lineData[high.dataSetIndex]). We've been unable to reproduce this "on demand".
I've found a workaround that seems to solve the issue. The solution involves calling chartView.highlightValues(nil) every time the chartView's data is changed. This approach seems to prevent crashes by ensuring that any previous highlight indices are cleared before attempting to use them again, which could be the source of the error. Here's an example of how to apply this workaround:
lineChartView.data = newData
lineChartView.highlightValues(nil) // Added line
...
lineChartView.highlightValue(highlight)
I came across this solution by referencing a similar issue discussed here: #4024.
It appears that the crashes may be related to attempts to use highlight indices from previous data sets, and resetting the highlight values upon data update prevents this issue.
What did you do?
We've been seeing A LOT of crashes reported in LineChartRenderer.drawHighlighted.
What did you expect to happen?
No crashes
What happened instead?
It crashes. We've finally got a stack trace that is the probable cause (invalid index in getting lineData[high.dataSetIndex]). We've been unable to reproduce this "on demand".
DGCharts Environment
DGCharts 5.0.0
Xcode version: 15.2
Platform(s) running DGCharts: iOS
The text was updated successfully, but these errors were encountered: