Victory-native: It looks like events are not working on victory-pie-native as they work on victory-pie

Created on 5 Nov 2016  路  9Comments  路  Source: FormidableLabs/victory-native

Good afternoon! Im running into an issue where events for the slice don't seem to be firing as expected. I also am running the demo and it appears that there is no changes on clicking on a pie chart as there is demos on the browser implementation. Are these things coming down the road or am I doing something stupid!

Thanks again. Daniel

<VictoryPie
      colorScale={ colorScale }
      data={ data }
      events={ [{
        target: 'data',
        eventHandlers: {
          onTouch: (evt, context, index) => {
            onSliceClick(Number(index))
          },
        },
      }] }
      height={ height }
      innerRadius={ calcInnerRadius }
      labelRadius={ 130 }
      labels={ [] }
      padding={ 50 }
      standalone={ standalone }
      width={ width }
      x={ x }
      y={ y }
    />

Most helpful comment

On mobile the name of the event is onPressIn

All 9 comments

Possible related issue added to bottom of issue #37

VictoryScatter onPress events do not fire if touch contact occurs on the marker that is bisected by the the data curve line or above.

For markers located below the data curve line, or pressing the bisected part of the marker below the line, the VictoryScatter onPress events generally work maybe 50% of the time.

I cannot get ths to work either.

i have the same problem, Have you solved it? @esutton

I also have this issue

Hey, any solution is there ? I am also facing the same one.

Yes, events are not fired on iOS and Android.

On mobile the name of the event is onPressIn

it don't work either

I got this to work on an Android emulator by wrapping my VictoryPie component with an Svg component, as described here:

https://stackoverflow.com/questions/57227291/victory-native-events-props-not-working-in-react-native-event-not-firing-in

I used the first answer that mentioned using const ChartClick. One thing it doesn't mention is that you need to obviously import these into your component file with the following:

import { TouchableOpacity } from "react-native";
import Svg from "react-native-svg";

Because I'm going for cross platform compatibility, this will allow the wrapper to be either TouchableOpacity or Svg for iOS and Android, respectively. Once I wrap my \

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzhw0130 picture jzhw0130  路  3Comments

ararog picture ararog  路  4Comments

xinhash picture xinhash  路  4Comments

kkemple picture kkemple  路  6Comments

ericschaal picture ericschaal  路  4Comments