crash Fatal error: Can't form Range with upperBound < lowerBound
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I write a demo with LineChartView just as your demo code.
if I set the data with follow with crash :
chartsDataArray.append(ChartDataEntry(x: 10, y: 20))
chartsDataArray.append(ChartDataEntry(x: 30, y: 12))
chartsDataArray.append(ChartDataEntry(x: 8, y: 24))
chartsDataArray.append(ChartDataEntry(x: 5, y: 14))
chartsDataArray.append(ChartDataEntry(x: 4, y: 4))
I just simple want draw a line with data above, it crashed with crash Fatal error: Can't form Range with upperBound < lowerBound.
But if I adjust the order of the data list , it won't crash.
I use XCode11 and Swift5.0 .
Thank Your !
Contributor guide
Research direction
Reproduce the crash in the LineChartView demo using the listed ChartDataEntry values in their original order, then compare it with the reordered data that does not crash. Trace the failure from LineChartView and determine which input ordering causes the invalid range; done means the original data renders without the fatal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- data-visualization, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100