margelo / react-native-graph

📈 Beautiful, high-performance Graphs and Charts for React Native built with Skia
https://margelo.io
MIT License
2.04k stars 115 forks source link

selection point not moving #26

Closed vardan0107 closed 2 years ago

vardan0107 commented 2 years ago

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 (

{value} {new Date(date).toString('MMM dd')} hapticFeedback('impactLight')} onPointSelected={p => { setValue(p.value); setDate(p.data); }} />

); }

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,

sunnylqm commented 2 years ago

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

acorscadden commented 2 years ago

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.

chrispader commented 2 years ago

This should be fixed with react-native-graph@0.2.0 and the latest skia version.

sunrise1002 commented 12 months ago

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"