-
Notifications
You must be signed in to change notification settings - Fork 79
useChartPressState with useChartTransformState #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, look at the implementation, maybe it will help. `import SpinerRendering from '@/components/SpinerRendering'; type Props = { const LineChartRendering = ({fetchData, timeRange, headData}: Props) => { const scrollOffset = useSharedValue(0); const {state: firstTouch, isActive: isFirstPressActive} = useChartPressState( let zoomLevel = timeRange; const pendingRangeDerived = useDerivedValue(() => { useEffect(() => { useEffect(() => { useEffect(() => { const indicatorColor = { const fetchDataMap = useMemo(() => {
}, [fetchData, shouldFilter, currentRange]); const generateTickValues = useCallback(() => { const formatYLabels = (value: number | undefined) => { const handleResetFilter = () => { if (!fetchData.length) {
); export default LineChartRendering; |
It currently seems impossible to create a chart that's both pannable and pressable. When you use
useChartPressState
withuseChartTransformState
, the panning works like a charm but the press state position is wrong - it doesn't take into account the panning.Surely someone has stumbled upon this problem in the past, right? If so, did you find any workaround to fix it other than creating a custom
PanResponder
to handle press state?The text was updated successfully, but these errors were encountered: