-
-
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
Fatal error: Can't form Range with upperBound < lowerBound #4046
Comments
same here |
Same here |
same here |
Me too... Seems like min/max values are in wrong order. |
same here |
But you hint me, you recently update the library, thus I can turn to a lower version to solve the problem temporarily. |
Downgraded the library from 3.3.0 to 3.2.2 and it works fine for now. |
Same here. Even after downgraded the versions to 3.2.2 :/ |
3.2.2 is fine. I recommend you clean xCode and run again. |
@danishnaeem57 @d0x90 @ali-ehsan @Cavech84 @xor22h @t0rn @Andy1984 @moosabaloch @pandapancake As a temporary fix, when you're creating your data sets before adding them to the chart sort them in place by their x values min < max. It doesn't fix the bug obviously but it'll let you draw your graphs.
|
@psseelman It work! Thanks! |
same here |
Thanks. Because I need to handle same x value but different y values in bubble chart and scatter chart, I have already found out that I need to sort dataEntries. Maybe it is not a bug because somewhere else mentioned that they need to be sorted. However, what I still do not understand there is not sorting code in the demo, and there is no documentation about the needs of sorting. |
thanks for reporting. Been busy recently. Can someone post a crash log and maybe code we could reproduce with ChartsDemo? from
It seems the source is not sorted? I didn't understand nor our CI detects this. If this is a bug and serious we should add a UT for it. |
Not only that, when the data behind the data set is smaller than the previous data, the chart will show obvious flicker, sometimes crashing. Now this library requires that the data in data set be sorted well. |
I'm not sure if I remembered correctly, but it's sorted a long time ago, I was thinking sorting is a requirement, but I didn't take a deep look. When you said 3.2.2 is fine, I need some data code snippet so I could test in ChartsDemo, I don't know if it's a regression. |
@jjatie do you know what could be wrong? |
same here |
Hi folks, I swapped the X and Y values and that solved the problem. Not sure if I was supposed to, but it's working fine now with 3.3.0. |
Hi, please find the crash log. This is still an issue. I can't sort my data by X values because it is essential that the data is represented in order the values have been added. Somehow the minimum visible entry becomes larger than the maximum visible entry. min Int 18 |
What's interesting is that the issue only appears to pop up with a large enough dataset. When testing the chart with a demo dataset of 11 data points it works perfectly fine. However, when I plug in a real dataset with about 30 datapoints the chart renders itself correctly but fails when I zoom it. |
This is STILL a problem with 3.4.0, as it was in 3.3.0 (just tested on both). The crash appears, for me, at 15 points. I don't immediately have access to a crash report but I will post if/when I do. Note that ordering the points so that x0 <= x1 <= x2... is not a real solution, because in cases of symbol overlap there may be a natural "stacking" order that is entirely different. |
I am also getting same issue I added two line in chat view. For one line, it is working fine. If I downgraded the library version, crash is resolved BUT second line did not appears from point when crash occurs in latest library version. |
@danielgindi any idea if this is by design or a defect? since I remember we need x values to be sorted? |
It's by design, the x values should be sorted, as many optimizations are based on that (stopping rendering loops when values are out of view) |
I am having this problem. The situation gets set up in the XBounds class at line 81. I added the following data to a CandleChartDataSet using samples.append(CandleChartDataEntry(x: Double(x), shadowH: y+100, shadowL: y-100, open: y, close: y)) Adding 108, 1545.0 Inside XBounds at
I end up with self.min = 18 low and high are low Double 1.7976931348623157E+308 which I suspect are reversed SOLVED: My chart has both lineData and Candle Data. My app works fine if I toggle the line chart on first and THEN the candle data. If I do it in reverse, I get this scenario. |
same here |
Why was this issue closed? It has not been fixed yet as far as I can tell. |
I'm using Core Data to feed data into my charts. My fetch request looked like this:
I dug a little deeper and found out the resulting arrays looked like this:
So the issue for me was the x-axis array was increasing rather than decreasing. The solution was to set |
same here |
Attaching my data. 4 different datasets, each sorted by x values. Gettings min = 1, max = 0 when redering the first dataset. po lineData.dataSets |
... I am also fighting this bug. It doesn't come up all the time on Version 3.6.0. My chart gets filled with real time sensor data, so it is hard to replicate, but I got luck and watched one occurrence on the debugger: The Iterator() get instantiated with: So the span on the x values is ca 950 and the above range is minus half of it -475. Charts.LineChartDataSet, label: A Solarstrom, 476 entries: |
may be this is the same issue like here #4592 |
Hi, LineChartView can't handle decreasing x values in dataset, I can't sort it because I need to represent a closed envelope. is there any solution? |
Well I tried, unsuccesfully. With modifications in your link the code did not draw a graph with my y values [5733.0,6615,7938,8158,9921,10450] and x values [225.47,242.99,242.99,242.76,240.94,240.43]. In original state it was crashing and now it just does not draw. And in "Testing details" there is a note: "The partitioningIndex function relies on the premise that the collection is already partitioned/sorted(!)" so I guess it can`t work unsorted..? What I can do is switch x and y and it works then, but I really need x horizontal and y vertical.. any trick to rotate all by 90 deg?:) |
Correct. Sorted data sets have been a (largely hidden) requirement for a while now. |
What I can do is to switch x and y and it works then, but I really need x horizontal and y vertical.. any trick to rotate all by 90 deg?:) I mean including labels, legend etc |
Please file a new issue as this is now a separate topic. |
hey @danielgindi , first of all, thanks for the awesome library.
I have recently updated the library and a crash is occurring in
"extension BarLineScatterCandleBubbleRenderer.XBounds: Sequence" in constructor. line is
fileprivate init(min: Int, max: Int) {
-----> self.iterator = (min...max).makeIterator()
}
Can you please tell me, why is it crashing and what am I doing wrong and how can I prevent it? Its astonishing that graphs have been working fine on previous versions of library.
Error on xcode debugger is:
Fatal error: Can't form Range with upperBound < lowerBound
The text was updated successfully, but these errors were encountered: