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

Created on 19 Oct 2019  Â·  13Comments  Â·  Source: danielgindi/Charts

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 !

Most helpful comment

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.

All 13 comments

   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

is it resolved?

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

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

On Tue, 29 Oct 2019 at 7:39 AM, Xuan notifications@github.com 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
.

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)

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

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 notifications@github.com 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
.

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

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?

I have the same issue

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

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

coop44483 picture coop44483  Â·  3Comments

heumn picture heumn  Â·  3Comments

deepumukundan picture deepumukundan  Â·  3Comments

brytnvmg picture brytnvmg  Â·  4Comments

JW00332 picture JW00332  Â·  4Comments