I'm working on creating a chart that allows for setting values by clicking and dragging. While the dragging functionality is working fine, I've run into an issue with the click event. When I click to set a new value, the draggable feature acts erratically because it removes the point before it can be dragged.
Here is the code I'm using for the click event:
events: {
click: function (e) {
// find the clicked values and the series
let x = Math.round(e.xAxis[0].value),
y = Math.round(e.yAxis[0].value),
series = this.series[0];
console.log("values",x,y,series);
// Add the new point
if(e.yAxis[0].value <= 16){
series.data[x].remove();
series.addPoint([x, y]);
}
}
}
The draggable functionality is being utilized through a plugin.