YUI.add("series-plot-util",function(e,r){var f=e.Lang,t=(0,e.ClassNameManager.getClassName)("seriesmarker");function s(r){this.addAttrs({markers:{getter:function(){return this._markers}}},r)}s.prototype={_plotDefaults:null,drawPlots:function(){if(this.get("xcoords")&&!(this.get("xcoords").length<1)){var r,e,t,s,a=f.isNumber,i=this._copyObject(this.get("styles").marker),o=i.width,l=i.height,h=this.get("xcoords"),n=this.get("ycoords"),c=0,u=h.length,g=(n[0],o/2),p=l/2,_=null,d=null,k=this.get("graphOrder");if(this.get("groupMarkers")){for(t=[],s=[];c<u;++c)t.push(parseFloat(h[c]-g)),s.push(parseFloat(n[c]-p));this._createGroupMarker({xvalues:t,yvalues:s,fill:i.fill,border:i.border,dimensions:{width:o,height:l},graphOrder:k,shape:i.shape})}else{for(f.isArray(i.fill.color)&&(_=i.fill.color.concat()),f.isArray(i.border.color)&&(d=i.border.color.concat()),this._createMarkerCache();c<u;++c)r=parseFloat(n[c]-p),a(e=parseFloat(h[c]-g))&&a(r)?(_&&(i.fill.color=_[c%_.length]),d&&(i.border.color=d[c%d.length]),i.x=e,i.y=r,this.getMarker(i,k,c)):this._markers.push(null);this._clearMarkerCache()}}},_groupShapes:{circle:e.CircleGroup,rect:e.RectGroup,ellipse:e.EllipseGroup,diamond:e.DiamondGroup},_getGroupShape:function(r){return r=f.isString(r)?this._groupShapes[r]:r},_getPlotDefaults:function(){var r={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};return r.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),r.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),r},_markers:null,_markerCache:null,getMarker:function(r,e,t){var s,a=r.border;if(r.id=this._getChart().get("id")+"_"+e+"_"+t,a.opacity=a.alpha,r.stroke=a,r.fill.opacity=r.fill.alpha,0<this._markerCache.length){for(;!s;){if(this._markerCache.length<1){s=this._createMarker(r);break}s=this._markerCache.shift()}s.set(r)}else s=this._createMarker(r);return this._markers.push(s),s},_createMarker:function(r){var e=this.get("graphic"),r=this._copyObject(r);return r.type=r.shape,(r=e.addShape(r)).addClass(t),r},_createMarkerCache:function(){this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null),this._markers&&0<this._markers.length?this._markerCache=this._markers.concat():this._markerCache=[],this._markers=[]},_createGroupMarker:function(r){var e,t=this.get("markers"),s=r.border;if(t&&0<t.length){for(;0<t.length;)t.shift().destroy();this.set("markers",[])}s.opacity=s.alpha,(s={id:this._getChart().get("id")+"_"+r.graphOrder,stroke:s,fill:r.fill,dimensions:r.dimensions,xvalues:r.xvalues,yvalues:r.yvalues}).fill.opacity=r.fill.alpha,(e=this._getGroupShape(r.shape))&&(s.type=e),r.hasOwnProperty("radius")&&!isNaN(r.radius)&&(s.dimensions.radius=r.radius),this._groupMarker&&this._groupMarker.destroy(),e=this.get("graphic"),this._groupMarker=e.addShape(s),e._redraw()},_toggleVisible:function(r){var e,t,s=this.get("markers"),a=0;if(s)for(t=s.length;a<t;++a)(e=s[a])&&e.set("visible",r)},_clearMarkerCache:function(){for(var r;0<this._markerCache.length;)(r=this._markerCache.shift())&&r.destroy()},updateMarkerState:function(r,e){var t,s,a,i;this._markers&&this._markers[e]&&(t=this._copyObject(this.get("styles").marker),r=this._getState(r),s=this.get("xcoords"),a=this.get("ycoords"),i=this._markers[e],(r="off"!==r&&t[r]?t[r]:t).fill.color=this._getItemColor(r.fill.color,e),r.border.color=this._getItemColor(r.border.color,e),r.stroke=r.border,i.set(r),t=r.width,r=r.height,i.set("x",s[e]-t/2),i.set("y",a[e]-r/2),i.set("visible",this.get("visible")))},_getItemColor:function(r,e){return f.isArray(r)?r[e%r.length]:r},_setStyles:function(r){return r=this._parseMarkerStyles(r),e.Renderer.prototype._setStyles.apply(this,[r])},_parseMarkerStyles:function(r){var e;return r.marker&&(e=this._getPlotDefaults(),r.marker=this._mergeStyles(r.marker,e),r.marker.over&&(r.marker.over=this._mergeStyles(r.marker.over,r.marker)),r.marker.down)&&(r.marker.down=this._mergeStyles(r.marker.down,r.marker)),r},_getState:function(r){var e;switch(r){case"mouseout":e="off";break;case"mouseover":case"mouseup":e="over";break;case"mousedown":e="down"}return e},_stateSyles:null,drawSeries:function(){this.drawPlots()},_getDefaultStyles:function(){return this._mergeStyles({marker:this._getPlotDefaults()},this.constructor.superclass._getDefaultStyles())}},e.augment(s,e.Attribute),e.Plots=s},"patched-v3.18.7");