react-highcharts icon indicating copy to clipboard operation
react-highcharts copied to clipboard

Cannot read property 'series' of undefined

Open ashritha-singu opened this issue 3 years ago • 0 comments

I keep getting 'series' undefined error while hovering over the chart. It is exactly happening when I try to update state values in the component.

Unable to reproduce in JSBin

plotOptions: {
      column: {
        point: {
          events: {
            mouseOver: eventsMouseOverHandler,
          },
        },
        states: {
          hover: {
            color: highchartsThemeColors.columnHoverColor,
          },
        },
      },
    },
const eventsMouseOverHandler: Highcharts.PointMouseOverCallbackFunction = React.useCallback((event: Event) => {
    const { x: pointX = null, y: pointY = null } = (event.target as unknown as HighchartsPoint) || {};
        setX(pointX);
        setY(pointY);
   }, [setX, setY]);

image

ashritha-singu avatar Jan 20 '22 02:01 ashritha-singu