jui-chart icon indicating copy to clipboard operation
jui-chart copied to clipboard

Support for touch events

Open syarul opened this issue 8 years ago • 2 comments

Can't seem to work with touch events on mobile web when interacting with the canvas ie: zoom, it's good if we can have this. What say you?

syarul avatar Aug 04 '16 10:08 syarul

Let's review positively.

seogi1004 avatar Aug 05 '16 04:08 seogi1004

I believe the basic of this is to add document event listener for touchstart, touchmove, touchend, and touchcancel.

So for example, it could be something similar like this

this.on("axis.touchmove", function(e) {
  if(isMove) return;

  isMove = true;
  touchStartX = e.bgX;
  touchStartY = e.bgY;
  startValueX = axis.x.invert(e.chartX);
  startValueY = axis.y.invert(e.chartY);
  this.chart.emit("dragselect.start");
}, brush.axis);

syarul avatar Aug 05 '16 10:08 syarul