react-native-pie
react-native-pie copied to clipboard
how to pass json value as percentage variable
i am trying to show pie chart from my json output but showing below error Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.
[[24,24,24,24,24],[2,2,2,2,2],[[759,"ARTGroup",271,{"transform":[1,0,0,1,0,0],"opacity":1}]],2468]
This error is located at: in ARTGroup (at Group.js:35) in Group (at Pie.js:129) in RoundDividers (at Pie.js:178) in ARTGroup (at Group.js:35) in Group (at Pie.js:169) in ARTSurfaceView (at Surface.js:37) in Surface (at Pie.js:168) in Pie (at ReportsDisplay.index.js:141) in RCTView (at View.js:34) in View (at ReportsDisplay.index.js:135) in RCTView (at View.js:34) in View (at ScrollView.js:1124) in RCTScrollView (at ScrollView.js:1260) in ScrollView (at ScrollView.js:1286) in ScrollView (at ReportsDisplay.index.js:132) in ReportScreen (at SceneView.tsx:122) in StaticContainer in StaticContainer (at SceneView.tsx:115) in EnsureSingleNavigator (at SceneView.tsx:114) in SceneView (at useDescriptors.tsx:153) in RCTView (at View.js:34) in View (at CardContainer.tsx:245) in RCTView (at View.js:34) in View (at CardContainer.tsx:244) in RCTView (at View.js:34) in View (at CardSheet.tsx:33) in ForwardRef(CardSheet) (at Card.tsx:573) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555) in PanGestureHandler (at GestureHandlerNative.tsx:13) in PanGestureHandler (at Card.tsx:549) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544) in RCTView (at View.js:34) in View (at Card.tsx:538) in Card (at CardContainer.tsx:206) in CardContainer (at CardStack.tsx:620) in RCTView (at View.js:34) in View (at Screens.tsx:84) in MaybeScreen (at CardStack.tsx:613) in RCTView (at View.js:34) in View (at Screens.tsx:54) in MaybeScreenContainer (at CardStack.tsx:495) in CardStack (at StackView.tsx:462) in KeyboardManager (at StackView.tsx:458) in RNCSafeAreaProvider (at SafeAreaContext.tsx:74) in SafeAreaProvider (at SafeAreaProviderCompat.tsx:42) in SafeAreaProviderCompat (at StackView.tsx:455) in GestureHandlerRootView (at GestureHandlerRootView.android.tsx:26) in GestureHandlerRootView (at StackView.tsx:454) in StackView (at createStackNavigator.tsx:87) in StackNavigator (at App.js:233) in EnsureSingleNavigator (at BaseNavigationContainer.tsx:409) in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91) in ThemeProvider (at NavigationContainer.tsx:90) in ForwardRef(NavigationContainer) (at App.js:232) in App (at App.js:432) in Provider (at App.js:431) in _default (at renderApplication.js:45) in RCTView (at View.js:34) in View (at AppContainer.js:106) in RCTView (at View.js:34) in View (at AppContainer.js:132) in AppContainer (at renderApplication.js:39)
need help
Not sure if you're still stuck on this or if this is the same issue, but I had a Malformed JS issue and it was due to passing infinite values across the RCTBridge; solution below...
percentage:
// (valueA /
// valueB) *
// 100,
Math.round(
(valueA / valueB) * 100
),
Not sure if you're still stuck on this or if this is the same issue, but I had a Malformed JS issue and it was due to passing infinite values across the
RCTBridge; solution below...percentage: // (valueA / // valueB) * // 100, Math.round( (valueA / valueB) * 100 ),
its working i am just passing my object property in Number method and its work fine thanks for reply