1

I am working on a react native project and I have a victory native bar chart with multiple bars. I have set up an event for onPressIn and it works as expected:

// This works a expected
events={[
  {
    eventHandlers: {
      onPressIn: e => {
        return [
          {
            mutation: props => {
              // code here
            },
          },
        ];
      },
    },
  },
]}

However there are multiple bars (15-25) and pressing is not really user friendly as it is quite hard to target a specific bar with your finger (bars are quite thin). So what I would like to do is implement onTouchEnter (or similar) so when user "swipes/moves finger" over the bars it will select any bar under finger at that moment (like onPressIn).

Slide finger over bars

I have already onTouchMove and onTouchEnter but it does not work:

// Does not work
events={[
  {
    eventHandlers: {
      // Also tried onTouchMove
      onTouchEnter: e => {
        return [
          {
            mutation: props => {
              // code here
            },
          },
        ];
      },
    },
  },
]}
boulev
  • 161
  • 6

0 Answers0