You must be logged in to post your query.
Home › Forums › Chart Support › How to open a modal on onClick event of a data point in react js
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
@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
You must be logged in to reply to this topic. Login/Register