/* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jplot.com jsDate | (c) 2010-2016 Chris Leonello */ !function(o){function t(t,e,r){var i=r.plugins.cursor,n="",a=!1;if(i.showTooltipGridPosition&&(n=t.x+", "+t.y,a=!0),i.showTooltipUnitPosition)for(var l,d=0;d"),i.useAxesFormatters)for(var c=0;c"),n+=o.jqplot.sprintf(i.tooltipFormatString,g,f,v),a=!0}}}i._tooltipElem.html(n)}function e(t,e){var r=e.plugins.cursor,i=r.cursorCanvas._ctx;i.clearRect(0,0,i.canvas.width,i.canvas.height),r.showVerticalLine&&r.shapeRenderer.draw(i,[[t.x,0],[t.x,i.canvas.height]]),r.showHorizontalLine&&r.shapeRenderer.draw(i,[[0,t.y],[i.canvas.width,t.y]]);var n=s(e,t.x,t.y);if(r.showCursorLegend)for(var a=o(e.targetId+" td.jqplot-cursor-legend-label"),l=0;l0;t--)l[e=a[t-1]].show&&(n[e]=l[e].series_p2u(i[e.charAt(0)]));return{offsets:r,gridPos:i,dataPos:n}}(o),a=n.gridPos,l=n.dataPos;s._zoom.gridpos=a,s._zoom.datapos=l,s._zoom.zooming=!0;var d=a.x,c=a.y,u=i.canvas.height,p=i.canvas.width;s.showTooltip&&!s.onGrid&&s.showTooltipOutsideZoom&&(t(a,l,e),s.followMouse&&r(a,e)),"x"==s.constrainZoomTo?s._zoom.end=[d,u]:"y"==s.constrainZoomTo?s._zoom.end=[p,c]:s._zoom.end=[d,c];var m=window.getSelection;document.selection&&document.selection.empty?document.selection.empty():m&&!m().isCollapsed&&m().collapse(),function(){var o,t,e,s,r=this._zoom.start,i=this._zoom.end,n=this.zoomCanvas._ctx;i[0]>r[0]?(o=r[0],s=i[0]-r[0]):(o=i[0],s=r[0]-i[0]),i[1]>r[1]?(t=r[1],e=i[1]-r[1]):(t=i[1],e=r[1]-i[1]),n.fillStyle="rgba(0,0,0,0.2)",n.strokeStyle="#999999",n.lineWidth=1,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.fillRect(0,0,n.canvas.width,n.canvas.height),n.clearRect(o,t,s,e),n.strokeRect(o,t,s,e),n=null}.call(s),i=null}}function u(t,e,s,r,i){var n=i.plugins.cursor;if(i.plugins.mobile?o(document).one("vmouseup.jqplot_cursor",{plot:i},p):o(document).one("mouseup.jqplot_cursor",{plot:i},p),i.axes,null!=document.onselectstart&&(n._oldHandlers.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),null!=document.ondrag&&(n._oldHandlers.ondrag=document.ondrag,document.ondrag=function(){return!1}),null!=document.onmousedown&&(n._oldHandlers.onmousedown=document.onmousedown,document.onmousedown=function(){return!1}),n.zoom){if(!n.zoomProxy){var a=n.zoomCanvas._ctx;a.clearRect(0,0,a.canvas.width,a.canvas.height),a=null}for(var l in"x"==n.constrainZoomTo?n._zoom.start=[e.x,0]:"y"==n.constrainZoomTo?n._zoom.start=[0,e.y]:n._zoom.start=[e.x,e.y],n._zoom.started=!0,s)n._zoom.axes.start[l]=s[l];i.plugins.mobile?o(document).bind("vmousemove.jqplotCursor",{plot:i},c):o(document).bind("mousemove.jqplotCursor",{plot:i},c)}}function p(t){var e=t.data.plot,s=e.plugins.cursor;if(s.zoom&&s._zoom.zooming&&!s.zoomTarget){var r=s._zoom.gridpos.x,i=s._zoom.gridpos.y,n=s._zoom.datapos,a=s.zoomCanvas._ctx.canvas.height,l=s.zoomCanvas._ctx.canvas.width,d=e.axes;if(s.constrainOutsideZoom&&!s.onGrid)for(var u in r<0?r=0:r>l&&(r=l),i<0?i=0:i>a&&(i=a),n)n[u]&&("x"==u.charAt(0)?n[u]=d[u].series_p2u(r):n[u]=d[u].series_p2u(i));"x"==s.constrainZoomTo?i=a:"y"==s.constrainZoomTo&&(r=l),s._zoom.end=[r,i],s._zoom.gridpos={x:r,y:i},s.doZoom(s._zoom.gridpos,n,e,s)}s._zoom.started=!1,s._zoom.zooming=!1,o(document).unbind("mousemove.jqplotCursor",c),null!=document.onselectstart&&null!=s._oldHandlers.onselectstart&&(document.onselectstart=s._oldHandlers.onselectstart,s._oldHandlers.onselectstart=null),null!=document.ondrag&&null!=s._oldHandlers.ondrag&&(document.ondrag=s._oldHandlers.ondrag,s._oldHandlers.ondrag=null),null!=document.onmousedown&&null!=s._oldHandlers.onmousedown&&(document.onmousedown=s._oldHandlers.onmousedown,s._oldHandlers.onmousedown=null)}o.jqplot.Cursor=function(t){this.style="crosshair",this.previousCursor="auto",this.show=o.jqplot.config.enablePlugins,this.showTooltip=!0,this.followMouse=!1,this.tooltipLocation="se",this.tooltipOffset=6,this.showTooltipGridPosition=!1,this.showTooltipUnitPosition=!0,this.showTooltipDataPosition=!1,this.tooltipFormatString="%.4P, %.4P",this.useAxesFormatters=!0,this.tooltipAxisGroups=[],this.zoom=!1,this.zoomProxy=!1,this.zoomTarget=!1,this.looseZoom=!0,this.clickReset=!1,this.dblClickReset=!0,this.showVerticalLine=!1,this.showHorizontalLine=!1,this.constrainZoomTo="none",this.shapeRenderer=new o.jqplot.ShapeRenderer,this._zoom={start:[],end:[],started:!1,zooming:!1,isZoomed:!1,axes:{start:{},end:{}},gridpos:{},datapos:{}},this._tooltipElem,this.zoomCanvas,this.cursorCanvas,this.intersectionThreshold=2,this.showCursorLegend=!1,this.cursorLegendFormatString=o.jqplot.Cursor.cursorLegendFormatString,this._oldHandlers={onselectstart:null,ondrag:null,onmousedown:null},this.constrainOutsideZoom=!0,this.showTooltipOutsideZoom=!1,this.onGrid=!1,o.extend(!0,this,t)},o.jqplot.Cursor.cursorLegendFormatString="%s x:%s, y:%s",o.jqplot.Cursor.init=function(t,e,s){var r=s||{};this.plugins.cursor=new o.jqplot.Cursor(r.cursor);var c=this.plugins.cursor;c.show&&(o.jqplot.eventListenerHooks.push(["jqplotMouseEnter",l]),o.jqplot.eventListenerHooks.push(["jqplotMouseLeave",a]),o.jqplot.eventListenerHooks.push(["jqplotMouseMove",d]),c.showCursorLegend&&(s.legend=s.legend||{},s.legend.renderer=o.jqplot.CursorLegendRenderer,s.legend.formatString=this.plugins.cursor.cursorLegendFormatString,s.legend.show=!0),c.zoom&&(o.jqplot.eventListenerHooks.push(["jqplotMouseDown",u]),c.clickReset&&o.jqplot.eventListenerHooks.push(["jqplotClick",i]),c.dblClickReset&&o.jqplot.eventListenerHooks.push(["jqplotDblClick",n])),this.resetZoom=function(){var o=this.axes;if(c.zoomProxy){var t=this.plugins.cursor.zoomCanvas._ctx;t.clearRect(0,0,t.canvas.width,t.canvas.height),t=null}else{for(var e in o)o[e].reset(),o[e]._ticks=[],void 0!==c._zoom.axes[e]&&(o[e]._autoFormatString=c._zoom.axes[e].tickFormatString);this.redraw()}this.plugins.cursor._zoom.isZoomed=!1,this.target.trigger("jqplotResetZoom",[this,this.plugins.cursor])},c.showTooltipDataPosition&&(c.showTooltipUnitPosition=!1,c.showTooltipGridPosition=!1,null==r.cursor.tooltipFormatString&&(c.tooltipFormatString=o.jqplot.Cursor.cursorLegendFormatString)))},o.jqplot.Cursor.postDraw=function(){var t=this.plugins.cursor;t.zoomCanvas&&(t.zoomCanvas.resetCanvas(),t.zoomCanvas=null),t.cursorCanvas&&(t.cursorCanvas.resetCanvas(),t.cursorCanvas=null),t._tooltipElem&&(t._tooltipElem.emptyForce(),t._tooltipElem=null),t.zoom&&(t.zoomCanvas=new o.jqplot.GenericCanvas,this.eventCanvas._elem.before(t.zoomCanvas.createElement(this._gridPadding,"jqplot-zoom-canvas",this._plotDimensions,this)),t.zoomCanvas.setContext());var e=document.createElement("div");if(t._tooltipElem=o(e),e=null,t._tooltipElem.addClass("jqplot-cursor-tooltip"),t._tooltipElem.css({position:"absolute",display:"none"}),t.zoomCanvas?t.zoomCanvas._elem.before(t._tooltipElem):this.eventCanvas._elem.before(t._tooltipElem),(t.showVerticalLine||t.showHorizontalLine)&&(t.cursorCanvas=new o.jqplot.GenericCanvas,this.eventCanvas._elem.before(t.cursorCanvas.createElement(this._gridPadding,"jqplot-cursor-canvas",this._plotDimensions,this)),t.cursorCanvas.setContext()),t.showTooltipUnitPosition&&0===t.tooltipAxisGroups.length){for(var s,r=this.series,i=[],n=0;n6&&Math.abs(t.y-u._zoom.start[1])>6||"x"==u.constrainZoomTo&&Math.abs(t.x-u._zoom.start[0])>6||"y"==u.constrainZoomTo&&Math.abs(t.y-u._zoom.start[1])>6){if(!s.plugins.cursor.zoomProxy){for(var f in e)null==u._zoom.axes[f]&&(u._zoom.axes[f]={},u._zoom.axes[f].numberTicks=p[f].numberTicks,u._zoom.axes[f].tickInterval=p[f].tickInterval,u._zoom.axes[f].daTickInterval=p[f].daTickInterval,u._zoom.axes[f].min=p[f].min,u._zoom.axes[f].max=p[f].max,u._zoom.axes[f].tickFormatString=null!=p[f].tickOptions?p[f].tickOptions.formatString:""),("none"==u.constrainZoomTo||"x"==u.constrainZoomTo&&"x"==f.charAt(0)||"y"==u.constrainZoomTo&&"y"==f.charAt(0))&&null!=(i=e[f])&&(i>g[f]?(n=g[f],a=i):(g[f],n=i,a=g[f]),d=null,(l=p[f]).alignTicks&&("x2axis"===l.name&&s.axes.xaxis.show?d=s.axes.xaxis.numberTicks:"y"===l.name.charAt(0)&&"yaxis"!==l.name&&"yMidAxis"!==l.name&&s.axes.yaxis.show&&(d=s.axes.yaxis.numberTicks)),!this.looseZoom||p[f].renderer.constructor!==o.jqplot.LinearAxisRenderer&&p[f].renderer.constructor!==o.jqplot.LogAxisRenderer?(p[f].min=n,p[f].max=a,p[f].tickInterval=null,p[f].numberTicks=null,p[f].daTickInterval=null):(c=o.jqplot.LinearTickGenerator(n,a,l._scalefact,d),p[f].tickInset&&c[0]p[f].max-p[f].tickInset*p[f].tickInterval&&(c[1]-=c[4],c[2]-=1),p[f].renderer.constructor===o.jqplot.LogAxisRenderer&&c[0]').appendTo(this._elem);n.data("seriesIndex",r),o('
').appendTo(n);var a=o('');a.appendTo(n),a.data("seriesIndex",r),this.escapeHtml?a.text(t):a.html(t),n=null,a=null}return this._elem}}(jQuery);