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