+ onZoomHandleTouchEvent = function(e) {
+ e.preventDefault();
+ if (e.type == 'touchstart') {
+ onZoomStart(e.targetTouches[0]);
+ } else if (e.type == 'touchmove') {
+ onZoom(e.targetTouches[0]);
+ } else {
+ onZoomEnd(e);
+ }
+ };
+
+ onCanvasTouchEvent = function(e) {
+ e.preventDefault();
+ if (e.type == 'touchstart') {
+ onPanStart(e.targetTouches[0]);
+ } else if (e.type == 'touchmove') {
+ onPan(e.targetTouches[0]);
+ } else {
+ onPanEnd(e);
+ }
+ };
+
+ addTouchEvents = function(elem, fn) {
+ var types = ['touchstart', 'touchend', 'touchmove', 'touchcancel'];
+ for (var i = 0; i < types.length; i++) {
+ self.dygraph_.addEvent(elem, types[i], fn);
+ }
+ };
+