react-native-charts-wrapper icon indicating copy to clipboard operation
react-native-charts-wrapper copied to clipboard

Crash while zooming and change data

Open FonDorn opened this issue 5 years ago • 3 comments

Expected Behavior

When I zoom Bar char and change chart data, chart show new data and current zoom.

Actual Behavior

When I zoom Bar char and change chart data the application is crash.

Crashlog

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [76221]

Application Specific Information:
Fatal error: Double value cannot be converted to Int because it is either infinite or NaN

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libswiftCore.dylib            	0x00000001060136f1 specialized _fatalErrorMessage(_:_:file:line:flags:) + 113
1   libswiftCore.dylib            	0x0000000105e49053 _fatalErrorMessage(_:_:file:line:flags:) + 19
2   org.cocoapods.Charts          	0x0000000101cbf6ab AxisRendererBase.computeAxisValues(min:max:) + 2059
3   org.cocoapods.Charts          	0x0000000101cbee29 AxisRendererBase.computeAxis(min:max:inverted:) + 1289 (AxisRendererBase.swift:85)
4   org.cocoapods.Charts          	0x0000000101cef8e8 BarLineChartViewBase.notifyDataSetChanged() + 888 (BarLineChartViewBase.swift:330)
5   com.bitfury.pool              	0x0000000101affcd5 RNChartViewBase.didSetProps(_:) + 325 (RNChartViewBase.swift:546)
6   com.bitfury.pool              	0x0000000101b0024d @objc RNChartViewBase.didSetProps(_:) + 141
7   org.cocoapods.React           	0x00000001023a883f __45-[RCTUIManager _dispatchPropsDidChangeEvents]_block_invoke + 559 (RCTUIManager.m:1205)
8   org.cocoapods.React           	0x00000001023a71da __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke + 442 (RCTUIManager.m:1103)
9   org.cocoapods.React           	0x00000001023a7606 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.540 + 454 (RCTUIManager.m:1126)
10  org.cocoapods.React           	0x00000001023b535d __RCTExecuteOnMainQueue_block_invoke + 29 (RCTUtils.m:248)
11  libdispatch.dylib             	0x0000000107c494e1 _dispatch_call_block_and_release + 12
12  libdispatch.dylib             	0x0000000107c4a54b _dispatch_client_callout + 8
13  libdispatch.dylib             	0x0000000107c56380 _dispatch_main_queue_callback_4CF + 1290
14  com.apple.CoreFoundation      	0x0000000103e8b3e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
15  com.apple.CoreFoundation      	0x0000000103e85a76 __CFRunLoopRun + 2342
16  com.apple.CoreFoundation      	0x0000000103e84e11 CFRunLoopRunSpecific + 625
17  com.apple.GraphicsServices    	0x0000000109f491dd GSEventRunModal + 62
18  com.apple.UIKitCore           	0x000000010d47281d UIApplicationMain + 140
19  com.bitfury.pool              	0x0000000101aa4650 main + 112 (main.m:14)
20  libdyld.dylib                 	0x0000000107cba575 start + 1

Data and config

data: {
        dataSets: [{
          values: [...],
          label: '...',
          config: {
            drawValues: false,
            color: processColor(Colors.black),
            highlightColor: processColor(Colors.highlight),
          },
        }],
        config: {
          barWidth: 0.9,
        },
      },
legend: {
        enabled: false,
      },
      xAxis: {
        valueFormatter: [...],
        granularityEnabled: true,
        granularity: 1,
        drawLabels: true,
        drawGridLines: false,
        drawAxisLine: false,
        avoidFirstLastClipping: false,
        position: 'BOTTOM',
      },
      yAxis: {
        left: {
          valueFormatter: 'largeValue',
          axisMinimum: 0,
          drawAxisLine: false,
          gridDashedLine: {
            lineLength: 5,
            spaceLength: 5,
          },
        },
        right: {
          enabled: false,
        },
      },
chartDescription: {
        text: '',
      },
marker: {
        enabled: true,
        markerColor: processColor(Colors.markerBackground),
        textColor: processColor(Colors.white),
        markerFontSize: 14,
      },
...
<BarChart
        style={styles.container}
        data={data}
        legend={legend}
        xAxis={xAxis}
        yAxis={yAxis}
        chartDescription={chartDescription}
        marker={marker}
      />

Steps to Reproduce the Problem

Zoom in Bar chart and change chart data. If chart is not zoom and change data all ok.

Specifications

  • Version: 0.5.0
  • Platform: iOS
  • CoreSimulator 581.2
  • Device: iPhone 7
  • Runtime: iOS 12.1 (16B91)
  • DeviceType: iPhone 7

FonDorn avatar Feb 13 '19 14:02 FonDorn

Can you provide an example to reproduce it?

wuxudong avatar Mar 04 '19 08:03 wuxudong

Same issue..

ezranbayantemur avatar Apr 17 '20 08:04 ezranbayantemur

@FonDorn I think it happens when trying to change the zoom while changing or removing the data. It can't draw the points for zoom and I believe nothing to do about it. Bad part is it throws Swift exception and confusing the mind while development. Maybe you can cover it with JS error message? @wuxudong

ezranbayantemur avatar Apr 17 '20 12:04 ezranbayantemur