react-native-graph icon indicating copy to clipboard operation
react-native-graph copied to clipboard

selection point not moving

Open vardan0107 opened this issue 2 years ago • 2 comments

Code: `import {View, Text, SafeAreaView, StyleSheet} from 'react-native'; import React from 'react'; import {useNavigation} from '@react-navigation/native'; import {getMutualFund} from '../services/MutualFundApi'; import {LineGraph} from 'react-native-graph'; import {hapticFeedback} from './hapticFeedBack'; export default function MutualFundDetailScreen({route}) { const navigation = useNavigation(); const loadMFDetails = async scheme_name => { let data = await getMutualFund(scheme_name); console.log(data); let tempArray = []; data.data.map(item => { var newdate = item.date.split('-').reverse().join('-'); tempArray.push({ data: new Date(newdate).getTime(), value: Number(item.nav), }); }); setPointsArray(tempArray); setMfData(data); }; React.useEffect(() => { if (route.params != undefined) { console.log(route.params.code); loadMFDetails(route.params.code); } }, []); const [mfData, setMfData] = React.useState(null); const [value, setValue] = React.useState(0); const [date, setDate] = React.useState(0); const [pointsArray, setPointsArray] = React.useState([]);

return ( <SafeAreaView style={styles.container}> <Text>{value}</Text> <Text>{new Date(date).toString('MMM dd')}</Text> <View> <LineGraph color="#31CBD1" style={{height: 200, width: 300, marginLeft:30}} points={pointsArray.reverse()} animated={true} enablePanGesture={true} selectionDotShadowColor="#333333" onGestureStart={() => hapticFeedback('impactLight')} onPointSelected={p => { setValue(p.value); setDate(p.data); }} /> </View> </SafeAreaView> ); }

const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'white', }, }); ` Screenshot 2022-06-24 at 2 54 06 AM

pointer is present at top corner , not moving when i drag my finger on graph,

vardan0107 avatar Jun 23 '22 21:06 vardan0107

reverted react-native-skia to 0.1.123 then it back to normal

sunnylqm avatar Jun 28 '22 04:06 sunnylqm

Ugh, I was having the same issue and couldn't figure it out. I also set react-native-skia to 0.1.123 and that fixed it for me too.

acorscadden avatar Jun 28 '22 19:06 acorscadden

This should be fixed with [email protected] and the latest skia version.

chrispader avatar Sep 12 '22 16:09 chrispader

I currently have this issue with

"react-native-gesture-handler": "^2.12.1"
"react-native-reanimated": "^3.5.0"
"@shopify/react-native-skia": "^0.1.202"
"react-native-graph": "^1.0.2"

sunrise1002 avatar Sep 29 '23 11:09 sunrise1002