Victory.js get x,y data from hovered line point

Viewed 26

How can I get the x,y data of a point on hover in a victory line component?

I tried this:

            <VictoryLine
              data={data}
              style={{ data: { stroke: Colors.green } }}
              events={[
                {
                  target: 'parent',
                  eventHandlers: {
                    onMouseOver: () => {
                      return [
                        {
                          target: 'data',
                          mutation: (props) => {
                            // props.data returns the values of all data points
                          },
                        },
                      ]
                    }
                  },
                },
              ]}
            />

Is there a possible way to do this in victory.js?

0 Answers
Related