react-native-graph
react-native-graph copied to clipboard
selection point not moving
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',
},
});
`
pointer is present at top corner , not moving when i drag my finger on graph,
reverted react-native-skia to 0.1.123 then it back to normal
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.
This should be fixed with [email protected]
and the latest skia version.
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"