Charts icon indicating copy to clipboard operation
Charts copied to clipboard

crash Fatal error: Can't form Range with upperBound < lowerBound

Open tangaowen opened this issue 5 years ago • 15 comments

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 !

tangaowen avatar Oct 19 '19 03:10 tangaowen

   lineView?.xAxis.labelTextColor = .orange
    lineView?.xAxis.axisMinimum = 0.0
    lineView?.xAxis.axisMaximum = 40.0
    
    
    lineView?.leftAxis.labelTextColor = .blue
    lineView?.leftAxis.axisMinimum = 0.0
    lineView?.leftAxis.axisMaximum = 25.0

tangaowen avatar Oct 19 '19 04:10 tangaowen

is it resolved?

harshitdiyoradd avatar Oct 21 '19 05:10 harshitdiyoradd

use ChartsDemo to reproduce please, and send us the code snippet.

liuxuan30 avatar Oct 29 '19 02:10 liuxuan30

Thanks for replying but now it’s working fine for me

On Tue, 29 Oct 2019 at 7:39 AM, Xuan [email protected] wrote:

use ChartsDemo to reproduce please, and send us the code snippet.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danielgindi/Charts/issues/4184?email_source=notifications&email_token=AHWSWLPPII45AHBDCRBEXH3QQ6LMTA5CNFSM4JCOBKHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECO7RZQ#issuecomment-547223782, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHWSWLLIOBKFCJEBAWXBBP3QQ6LMTANCNFSM4JCOBKHA .

harshitdiyoradd avatar Oct 29 '19 07:10 harshitdiyoradd

again getting same error i have used charts in one of my ios app. here is the error i'm getting

"Fatal error: Can't form Range with upperBound < lowerBound"

Screenshot 2019-11-07 at 3 07 18 PM (2)

harshitdiyoradd avatar Nov 07 '19 09:11 harshitdiyoradd

please debug a little with your crash, it's easier on your side to tell us what's the problem. it seems your min and max are flipped, however I need to know why

liuxuan30 avatar Nov 13 '19 00:11 liuxuan30

okay

but i didn't change anything in code.it's working perfectly sometime and suddenly getting this error

On Wed, Nov 13, 2019 at 6:09 AM Xuan [email protected] wrote:

please debug a little with your crash, it's easier on your side to tell us what's the problem. it seems your min and max are flipped, however I need to know why

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danielgindi/Charts/issues/4184?email_source=notifications&email_token=AHWSWLJIWE43QXO4LUESNYDQTNEE5A5CNFSM4JCOBKHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED4OSYA#issuecomment-553183584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHWSWLNL6EMBSNYVROWFUZDQTNEE5ANCNFSM4JCOBKHA .

harshitdiyoradd avatar Nov 13 '19 03:11 harshitdiyoradd

I recently updated my iOS and after that my graph stoped working with the same error as above

Draffy2314 avatar Nov 14 '19 17:11 Draffy2314

anyone who met this exact crash could easily go back and check the stack frames and tell us why the min/max are flipped, could you help to check?

liuxuan30 avatar Nov 15 '19 00:11 liuxuan30

I have the same issue

gerchicov-bp avatar Dec 03 '19 09:12 gerchicov-bp

i'm facing same issue.can you please fix it ASAP as i have live app crashing. Screen Recording 2019-12-12 at 4.00.09 PM.mov.zip

Timir11 avatar Dec 12 '19 10:12 Timir11

Had same issue before and saw another post with temporary fix code chartDataEntries.sort(by: { $0.x < $1.x }). Put it after you finish appending chartDataEntries. It's working for me so far but if you want to do something more than just showing the Chart it may not work.

pandapancake avatar Dec 13 '19 04:12 pandapancake

Hi, I'm using the react-native-charts-wrapper library as a wrapper to this for working with react-native (Url: https://github.com/wuxudong/react-native-charts-wrapper )and I'm encountering this issue on a particular chart in the xaxis which induces a crash on the application. Hence, if there's a fork available or please provide a fix in the next version. Please do the needy, tell me what to do. Thanks in advance.

Also @pandapancake can you please specify exactly where to do the changes mentioned by. It'd be a great help. Thanks.

mohitpasiapac avatar Sep 06 '20 18:09 mohitpasiapac

Here is how to reproduce this on the demo app

iOS demo app

  • tap line chart dual Y axis
  • Double tap center of chart
  • Scroll till you hit the right most side

you will get the Range requires lowerBound <= upperBound error... or at least I have always gotten the error

This happens in the same order with "line chart dual Y axis", "Combined chart", and "Scatter Chart" on the demo app

I am also only experiencing this error in my project with 4.0+, not in 3.6

gmhcode avatar Jul 15 '21 16:07 gmhcode

I am also facing this problem on 4.0+ but on 3.6 works normally.

josipbernat avatar Aug 23 '22 12:08 josipbernat