//>>built
define("dojox/charting/action2d/TouchIndicator",["dojo/_base/lang","dojo/_base/declare","dojo/_base/event","dojo/touch","./ChartAction","./_IndicatorElement","dojox/lang/utils"],function(_1,_2,_3,_4,_5,_6,du){
return _2("dojox.charting.action2d.TouchIndicator",_5,{defaultParams:{series:"",dualIndicator:false,vertical:true,autoScroll:true,fixed:true,precision:0,lines:true,labels:true,markers:true},optionalParams:{lineStroke:{},outlineStroke:{},shadowStroke:{},lineFill:{},stroke:{},outline:{},shadow:{},fill:{},fillFunc:null,labelFunc:null,font:"",fontColor:"",markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerSymbol:"",offset:{},start:false},constructor:function(_7,_8,_9){
this._listeners=[{eventName:_4.press,methodName:"onTouchStart"},{eventName:_4.move,methodName:"onTouchMove"},{eventName:_4.release,methodName:"onTouchEnd"},{eventName:_4.cancel,methodName:"onTouchEnd"}];
this.opt=_1.clone(this.defaultParams);
du.updateWithObject(this.opt,_9);
du.updateWithPattern(this.opt,_9,this.optionalParams);
this._uName="touchIndicator"+this.opt.series;
this.connect();
},connect:function(){
this.inherited(arguments);
this.chart.addPlot(this._uName,{type:_6,inter:this});
},disconnect:function(){
var _a=this.chart.getPlot(this._uName);
if(_a.pageCoord){
this.onTouchEnd();
}
this.chart.removePlot(this._uName);
this.inherited(arguments);
},onChange:function(_b){
},onTouchStart:function(_c){
if(!_c.touches||_c.touches.length==1){
this._onTouchSingle(_c,true);
}else{
if(this.opt.dualIndicator&&_c.touches.length==2){
this._onTouchDual(_c);
}
}
},onTouchMove:function(_d){
if(!_d.touches||_d.touches.length==1){
this._onTouchSingle(_d);
}else{
if(this.opt.dualIndicator&&_d.touches.length==2){
this._onTouchDual(_d);
}
}
},_onTouchSingle:function(_e,_f){
if(this.chart._delayedRenderHandle&&!_f){
this.chart.render();
}
var _10=this.chart.getPlot(this._uName);
_10.pageCoord={x:_e.touches?_e.touches[0].pageX:_e.pageX,y:_e.touches?_e.touches[0].pageY:_e.pageY};
_10.dirty=true;
if(_f){
this.chart.delayedRender();
}else{
this.chart.render();
}
_3.stop(_e);
},_onTouchDual:function(_11){
if(this.chart._delayedRenderHandle){
this.chart.render();
}
var _12=this.chart.getPlot(this._uName);
_12.pageCoord={x:_11.touches[0].pageX,y:_11.touches[0].pageY};
_12.secondCoord={x:_11.touches[1].pageX,y:_11.touches[1].pageY};
_12.dirty=true;
this.chart.render();
_3.stop(_11);
},onTouchEnd:function(_13){
var _14=this.chart.getPlot(this._uName);
_14.stopTrack();
_14.pageCoord=null;
_14.secondCoord=null;
_14.dirty=true;
this.chart.delayedRender();
}});
});
