Home › Forums › Chart Support › How to open a modal on onClick event of a data point in react js

How to open a modal on onClick event of a data point in react js

Viewing 2 posts - 1 through 2 (of 2 total)
  • #35927

    I want to call a modal onClick of data point on the scattered graph. Below is the snippet of the code.

    Data.push({ label:moment().format(“h:mm:s”), y:2, labelHover:moment().format(“h:mm:s”),click: onClick})

    function onClick(e){
    this.setState({ interruptModal: true })

    }

    I’m getting the below error once the onclick function is called:

    ×TypeError: this.setState is not a function

    #35932

    @gowri-d,

    Can you kindly create a sample project reproducing the issue you are facing and share it with us over Google-Drive or OneDrive so that we can look into the code, run it locally at our end to understand the scenario better and help you out?

    —
    Manoj Mohan
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.