(function(e){function l(b,f){var g=b.plugins.highlighter,a=b.series[f.seriesIndex],d=a.markerRenderer,h=g.markerRenderer;h.style=d.style;h.lineWidth=d.lineWidth+g.lineWidthAdjust;h.size=d.size+g.sizeAdjust;d=e.jqplot.getColorComponents(d.color);var c=[d[0],d[1],d[2]];h.color="rgba("+c[0]+","+c[1]+","+c[2]+","+(d[3]>=0.6?d[3]*0.6:d[3]*(2-d[3]))+")";h.init();h.draw(a.gridData[f.pointIndex][0],a.gridData[f.pointIndex][1],g.highlightCanvas._ctx)}function m(b,f,g){var a=b.plugins.highlighter,d=a._tooltipElem;
a=e.extend(true,{},a,f.highlighter||{});if(a.useAxesFormatters){var h=f._xaxis._ticks[0].formatter,c=f._yaxis._ticks[0].formatter,j=f._yaxis._ticks[0].formatString;h=h(f._xaxis._ticks[0].formatString,g.data[0]);for(var i=[],k=1;k<a.yvalues+1;k++)i.push(c(j,g.data[k]));if(typeof a.formatString==="string")switch(a.tooltipAxes){case "both":case "xy":i.unshift(h);i.unshift(a.formatString);c=e.jqplot.sprintf.apply(e.jqplot.sprintf,i);break;case "yx":i.push(h);i.unshift(a.formatString);c=e.jqplot.sprintf.apply(e.jqplot.sprintf,
i);break;case "x":c=e.jqplot.sprintf.apply(e.jqplot.sprintf,[a.formatString,h]);break;case "y":i.unshift(a.formatString);c=e.jqplot.sprintf.apply(e.jqplot.sprintf,i);break;default:i.unshift(h);i.unshift(a.formatString);c=e.jqplot.sprintf.apply(e.jqplot.sprintf,i)}else switch(a.tooltipAxes){case "both":case "xy":c=h;for(k=0;k<i.length;k++)c+=a.tooltipSeparator+i[k];break;case "yx":c="";for(k=0;k<i.length;k++)c+=i[k]+a.tooltipSeparator;c+=h;break;case "x":c=h;break;case "y":c=i.join(a.tooltipSeparator);
break;default:c=h;for(k=0;k<i.length;k++)c+=a.tooltipSeparator+i[k]}}else if(typeof a.formatString==="string")c=e.jqplot.sprintf.apply(e.jqplot.sprintf,[a.formatString].concat(g.data));else if(a.tooltipAxes=="both"||a.tooltipAxes=="xy")c=e.jqplot.sprintf(a.tooltipFormatString,g.data[0])+a.tooltipSeparator+e.jqplot.sprintf(a.tooltipFormatString,g.data[1]);else if(a.tooltipAxes=="yx")c=e.jqplot.sprintf(a.tooltipFormatString,g.data[1])+a.tooltipSeparator+e.jqplot.sprintf(a.tooltipFormatString,g.data[0]);
else if(a.tooltipAxes=="x")c=e.jqplot.sprintf(a.tooltipFormatString,g.data[0]);else if(a.tooltipAxes=="y")c=e.jqplot.sprintf(a.tooltipFormatString,g.data[1]);if(e.isFunction(a.tooltipContentEditor))c=a.tooltipContentEditor(c,g.seriesIndex,g.pointIndex,b);d.html(c);c={x:g.gridData[0],y:g.gridData[1]};j=0;if(f.markerRenderer.show==true)j=(f.markerRenderer.size+a.sizeAdjust)/2;h=n;if(f.fillToZero&&f.fill&&g.data[1]<0)h=o;switch(h[p[a.tooltipLocation]]){case "nw":f=c.x+b._gridPadding.left-d.outerWidth(true)-
a.tooltipOffset-0.707*j;b=c.y+b._gridPadding.top-a.tooltipOffset-d.outerHeight(true)-0.707*j;break;case "n":f=c.x+b._gridPadding.left-d.outerWidth(true)/2;b=c.y+b._gridPadding.top-a.tooltipOffset-d.outerHeight(true)-j;break;case "ne":f=c.x+b._gridPadding.left+a.tooltipOffset+0.707*j;b=c.y+b._gridPadding.top-a.tooltipOffset-d.outerHeight(true)-0.707*j;break;case "e":f=c.x+b._gridPadding.left+a.tooltipOffset+j;b=c.y+b._gridPadding.top-d.outerHeight(true)/2;break;case "se":f=c.x+b._gridPadding.left+
a.tooltipOffset+0.707*j;b=c.y+b._gridPadding.top+a.tooltipOffset+0.707*j;break;case "s":f=c.x+b._gridPadding.left-d.outerWidth(true)/2;b=c.y+b._gridPadding.top+a.tooltipOffset+j;break;case "sw":f=c.x+b._gridPadding.left-d.outerWidth(true)-a.tooltipOffset-0.707*j;b=c.y+b._gridPadding.top+a.tooltipOffset+0.707*j;break;case "w":f=c.x+b._gridPadding.left-d.outerWidth(true)-a.tooltipOffset-j;b=c.y+b._gridPadding.top-d.outerHeight(true)/2;break;default:f=c.x+b._gridPadding.left-d.outerWidth(true)-a.tooltipOffset-
0.707*j;b=c.y+b._gridPadding.top-a.tooltipOffset-d.outerHeight(true)-0.707*j}d.css("left",f);d.css("top",b);a.fadeTooltip?d.stop(true,true).fadeIn(a.tooltipFadeSpeed):d.show()}e.jqplot.eventListenerHooks.push(["jqplotMouseMove",function(b,f,g,a,d){b=d.plugins.highlighter;f=d.plugins.cursor;if(b.show)if(a==null&&b.isHighlighting){g=b.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height);b.fadeTooltip?b._tooltipElem.fadeOut(b.tooltipFadeSpeed):b._tooltipElem.hide();b.bringSeriesToFront&&
d.restorePreviousSeriesOrder();b.isHighlighting=false;b.currentNeighbor=null}else if(a!=null&&d.series[a.seriesIndex].showHighlight&&!b.isHighlighting){b.isHighlighting=true;b.currentNeighbor=a;b.showMarker&&l(d,a);if(b.showTooltip&&(!f||!f._zoom.started))m(d,d.series[a.seriesIndex],a);b.bringSeriesToFront&&d.moveSeriesToFront(a.seriesIndex)}else if(a!=null&&b.isHighlighting&&b.currentNeighbor!=a)if(d.series[a.seriesIndex].showHighlight){g=b.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height);
b.isHighlighting=true;b.currentNeighbor=a;b.showMarker&&l(d,a);if(b.showTooltip&&(!f||!f._zoom.started))m(d,d.series[a.seriesIndex],a);b.bringSeriesToFront&&d.moveSeriesToFront(a.seriesIndex)}}]);e.jqplot.Highlighter=function(b){this.show=e.jqplot.config.enablePlugins;this.markerRenderer=new e.jqplot.MarkerRenderer({shadow:false});this.showMarker=true;this.lineWidthAdjust=2.5;this.sizeAdjust=5;this.showTooltip=true;this.tooltipLocation="nw";this.fadeTooltip=true;this.tooltipFadeSpeed="fast";this.tooltipOffset=
2;this.tooltipAxes="both";this.tooltipSeparator=", ";this.tooltipContentEditor=null;this.useAxesFormatters=true;this.tooltipFormatString="%.5P";this.formatString=null;this.yvalues=1;this.isHighlighting=this.bringSeriesToFront=false;this.currentNeighbor=null;e.extend(true,this,b)};var n=["nw","n","ne","e","se","s","sw","w"],p={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7},o=["se","s","sw","w","nw","n","ne","e"];e.jqplot.Highlighter.init=function(b,f,g){this.plugins.highlighter=new e.jqplot.Highlighter((g||
{}).highlighter)};e.jqplot.Highlighter.parseOptions=function(){this.showHighlight=true};e.jqplot.Highlighter.postPlotDraw=function(){if(this.plugins.highlighter&&this.plugins.highlighter.highlightCanvas){this.plugins.highlighter.highlightCanvas.resetCanvas();this.plugins.highlighter.highlightCanvas=null}if(this.plugins.highlighter&&this.plugins.highlighter._tooltipElem){this.plugins.highlighter._tooltipElem.emptyForce();this.plugins.highlighter._tooltipElem=null}this.plugins.highlighter.highlightCanvas=
new e.jqplot.GenericCanvas;this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding,"jqplot-highlight-canvas",this._plotDimensions,this));this.plugins.highlighter.highlightCanvas.setContext();var b=document.createElement("div");this.plugins.highlighter._tooltipElem=e(b);this.plugins.highlighter._tooltipElem.addClass("jqplot-highlighter-tooltip");this.plugins.highlighter._tooltipElem.css({position:"absolute",display:"none"});this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem)};
e.jqplot.preInitHooks.push(e.jqplot.Highlighter.init);e.jqplot.preParseSeriesOptionsHooks.push(e.jqplot.Highlighter.parseOptions);e.jqplot.postDrawHooks.push(e.jqplot.Highlighter.postPlotDraw)})(jQuery);
