ChartsOrg / ChartsOrg/Charts

App crashes because min is bigger than max in BarLineScatterCandleBubbleRenderer

Open
#4,694 10 comments 2 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/danielgindi/Charts/blob/e91ba716190836b013ef8a9ca53e220ad5051e21/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift#L137

I have the next `dataSet`:

`Charts.ScatterChartDataSet, label: meanDistance, 33 entries:
ChartDataEntry, x: -4.40704, y 6.406
ChartDataEntry, x: -13.644354, y 33.403999
ChartDataEntry, x: -21.630138, y 0.0
ChartDataEntry, x: -25.023655, y 0.0
ChartDataEntry, x: -17.247274, y 0.0
ChartDataEntry, x: -14.16761, y 0.0
ChartDataEntry, x: -25.32449, y 0.0
ChartDataEntry, x: -25.683102, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -24.422508, y 0.0
ChartDataEntry, x: -26.767139, y 0.0
ChartDataEntry, x: -29.922995, y 0.0
ChartDataEntry, x: -13.131207, y 0.0
ChartDataEntry, x: -25.449869, y 0.0
ChartDataEntry, x: -39.987324, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -28.313265, y 0.0
ChartDataEntry, x: -36.445889, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -20.190897, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -31.819294, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: -22.258247, y 0.0
ChartDataEntry, x: -40.0, y 0.0
ChartDataEntry, x: 2.783774, y 0.0
ChartDataEntry, x: -28.920076, y 0.0
ChartDataEntry, x: -14.184858, y 0.0
ChartDataEntry, x: -40.0, y 251.194
ChartDataEntry, x: -15.427558, y 262.764008
ChartDataEntry, x: 23.794905, y 283.588989`

in the function `set(chart: BarLineScatterCandleBubbleChartDataProvider, dataSet: IBarLineScatterCandleBubbleChartDataSet, animator: Animator?)` which set:

- min to 20.
- max to 10.
- range to 0.

Making the app crashes in the line of code I mentioned at the beginning.

The points are golf shots where the x value is the `Off Target Line` and the y value of the `flat Carry`. In version `3.2.2` of Charts, the app works correctly with that data set.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.