-
Notifications
You must be signed in to change notification settings - Fork 46
/
fusioncharts.zoomline.js
2 lines (2 loc) · 30.5 KB
/
fusioncharts.zoomline.js
1
2
!function(e){"object"==typeof module&&"undefined"!=typeof module.exports?module.exports=e:e()}((function(){"use strict";(self.webpackChunkFusionCharts=self.webpackChunkFusionCharts||[]).push([[15],{1576:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o=i(n(288)),a=n(274),r=i(n(783)),s=i(n(1577)),l=i(n(1579)),c=n(286),u=n(690),d=n(1580),h=n(282),p=window.navigator.userAgent,g=(0,h.getDep)("redraphael","plugin"),f=window.doc,m="rgba(192,192,192,"+(/msie/i.test(p)&&!window.opera?.002:1e-6)+")",v=window.parseFloat,b=window.parseInt,x=Math,C=x.max,y=x.min,k=x.ceil,E=x.floor,w=0,M=function(e,t){var n=t.get("config"),i=(0,a.getMouseCoordinate)(t.get("linkedItems","container"),e,t),o=i.chartX,r=i.chartY,s=n.canvasLeft,l=n.canvasTop,c=n.canvasLeft+n.canvasWidth,u=n.canvasHeight+n.canvasTop;return i.insideCanvas=!1,i.originalEvent=e,o>s&&o<c&&r>l&&r<u&&(i.insideCanvas=!0),i};g.addSymbol(d.symbolList);var P=function(e){function t(){var t;return(t=e.call(this)||this).zoomX=!0,t.hasScroll=!0,t.eiMethods={zoomOut:function(e){var t,n=this.apiInstance,i=n.getChildren&&n.getChildren("canvas")[0],o=i&&i.getChildren("inputManager");o=o&&o[0],n&&o&&n.addJob("zoomOut"+w++,(function(){t=o.zoomOut(),"function"==typeof e&&e(t)}),c.priorityList.postRender)},zoomTo:function(e,t,n){var i,o=this.apiInstance,r=o.getChildren&&o.getChildren("canvas")[0],s=r&&r.getChildren("inputManager");if(e!==a.UNDEF&&t!==a.UNDEF&&(s=s&&s[0],o&&s))return n?void o.addJob("zoomTo"+w++,(function(){i=s.zoomTo(e,t),"function"==typeof n&&n(i)}),c.priorityList.postRender):s.zoomTo(e,t)},resetChart:function(){var e=this.apiInstance,t=e.getChildren&&e.getChildren("canvas")[0],n=t&&t.getChildren("inputManager");n=n&&n[0],e&&n&&e.addJob("resetChart"+w++,(function(){n.resetChart()}),c.priorityList.postRender)},setZoomMode:function(e){var t=this.apiInstance,n=t.getChildren&&t.getChildren("canvas")[0],i=n&&n.getChildren("inputManager");i=i&&i[0],t&&i&&t.addJob("setZoomMode"+w++,(function(){i.setZoomMode(e)}),c.priorityList.postRender)},getViewStartIndex:function(e){var t,n,i,o=this.apiInstance;if(!e)return t=o.getChildren("xAxis")[0],n=t.getVisibleConfig().minValue,0===(i=Math.ceil(n))?0:i;o.addJob("getViewStartIndex"+w++,(function(){"function"==typeof e&&(t=o.getChildren("xAxis")[0],n=t.getVisibleConfig().minValue,i=Math.ceil(n),e(0===i?0:i))}),c.priorityList.postRender)},getViewEndIndex:function(e){var t,n,i=this.apiInstance;if(!e)return t=i.getChildren("xAxis")[0],n=t.getVisibleConfig().maxValue,Math.floor(n);i.addJob("getViewEndIndex"+w++,(function(){"function"==typeof e&&(t=i.getChildren("xAxis")[0],n=t.getVisibleConfig().maxValue,e(Math.floor(n)))}),c.priorityList.postRender)}},t.eiMethods.scrollTo=u.scrollTo,t.registerFactory("dataset",l["default"],["vCanvas"]),t}(0,o["default"])(t,e),t.getName=function(){return"ZoomLine"},t.includeInputOptions=function(){return["DragZoomIn","DragPin","ZoomResetButton","ZoomOutButton"]};var n=t.prototype;return n.__setDefaultConfig=function(){e.prototype.__setDefaultConfig.call(this);var t=this.config;t.friendlyName="Zoomable and Panable Multi-series Line Chart",t.defaultDatasetType="zoomline",t.showValues=0,t.zeroplanethickness=1,t.zeroplanealpha=40,t.showzeroplaneontop=0,t.enablemousetracking=!0,t.skipAttr=!0,t.canvasborderthickness=1,t.showvalues=0},n.getName=function(){return"ZoomLine"},n.parseChartAttr=function(t){e.prototype.parseChartAttr.call(this,t);var n=this.config,i=(t||this.getFromEnv("dataSource")).chart;n.useCrossline=Number(i.usecrossline)||i.usecrossline===a.UNDEF?1:0,n.drawTrendRegion=0},n.getInputConfigurations=function(){var e=this,t=e.config,n=function(n,i){e.addJob("inputZoom",(function(){var o=t.viewPortConfig;o.dsi=n,o.dei=i,e.updateManager(),e.getChildren("xAxis")[0].prepareAttributes()}),c.priorityList.configure)},i={dragZoomIn:{scaleX:!0,scaleY:!1,drawButton:!1,boxStyle:{stroke:t.zoomPaneStroke,fill:t.zoomPaneFill,"stroke-width":0},catZoomLimit:2,skipGraphics:!0,dragendFn:function(){return n(arguments.length<=1?undefined:arguments[1],arguments.length<=2?undefined:arguments[2])}},zoomResetButton:{hookFn:n,tooltext:t.btnResetChartTooltext},zoomOutButton:{hookFn:n,tooltext:t.btnZoomOutTooltext},dragPin:{orientation:"horizontal",attr:{stroke:t.zoomPaneStroke,fill:t.zoomPaneFill,"stroke-width":0},skipGraphics:!t.allowPinMode,pinAttr:{"stroke-width":0,stroke:"none",fill:t.pinPaneFill,"shape-rendering":"crisp"},strokeWidth:0,tooltext:t.showToolBarButtonTooltext&&t.btnSwitchToPinModeTooltext||""}};return i},n._setCategories=function(){var e,t,n,i,o=this,r=o.config,s=o.getFromEnv("dataSource"),l=s.chart||{},c=o.getChildren("xAxis"),u=r.cdm,d=r.cdmchar,h=s.categories&&s.categories[0].category||[];if(r.cdm=u=(0,a.pluckNumber)(l.compactdatamode,0),r.cdmchar=d=(0,a.pluck)(l.dataseparator,"|"),(u||"string"==typeof h)&&h.split){for(t=[],n=0,i=(e=h.split(d)).length;n<i;n+=1)t.push({label:e[n]});o.config.categories=s.categories[0].category=t}c[0].setAxisPadding(0,0),c[0].setTickValues(t||h)},n.isWithinCanvas=function(e,t){return M.call(this,e,t)},n.highlightPoint=function(e,t,n,i,o,a){var r,s,l,c,u,d,h=this,p=h.config,g=h.getFromEnv("animationManager"),v=h.components,b=h.graphics,x=Number(e),C=b.tracker,y=v.dataset[o],k=y&&y.config,E=y&&k.zoomedRadius||0,w=y&&k.hoverCosmetics,M=w&&w.fill,P=w&&w.borderColor,L=w&&w.borderThickness,_=function(e){h.plotEventHandler(this,e)},S=function(e){h.plotEventHandler(this,e,"dataplotRollover")},T=function(e){h.plotEventHandler(this,e,"dataplotRollout")};C||(r=b.tracker=g.setAnimation({el:"circle",attr:{cx:0,cy:0,r:E,fill:x?M:m,stroke:x?P:m,"stroke-width":x?L:0,"clip-rect":p.canvasLeft+","+p.canvasTop+","+p.canvasWidth+","+p.canvasHeight},container:b.trackerGroup,component:h}).on("fc-click",_).hover(S,T)),i&&r.data("eventArgs",{x:i.x,y:i.y,tooltip:i.tooltip,link:i.link}),p.lastHoveredPoint=i,h.getFromEnv("toolTipController").enableToolTip(r,a),r.transform("t"+(t+p.canvasLeft)+","+(n+p.canvasTop)),i&&(s="mouseover",l=r&&r.node,c=p.lastMouseEvent,d=c,l&&s&&(d||(d={}),d.originalEvent&&(d=d.originalEvent),d.touches&&(d=d.touches[0]),l.dispatchEvent?(MouseEvent?u=new MouseEvent(s,{bubbles:!!d.bubbles,cancelable:!!d.cancelable,clientX:d.clientX||d.pageX&&d.pageX-f.body.scrollLeft-f.documentElement.scrollLeft||0,clientY:d.clientY||d.pageY&&d.pageY-f.body.scrollTop-f.documentElement.scrollTop||0,screenX:d.screenX||0,screenY:d.screenY||0,pageX:d.pageX||0,pageY:d.pageY||0}):f.createEvent&&(u=f.createEvent("HTMLEvents")).initEvent(s,!!d.bubbles,!!d.cancelable),u.eventName=s,u&&l.dispatchEvent(u)):f.createEventObject&&l.fireEvent&&((u=f.createEventObject()).eventType=s,u.eventName=s,l.fireEvent("on"+s,u))))},n.configureAttributes=function(t){e.prototype.configureAttributes.call(this,t);var n,i,o=this,r=o.getFromEnv("dataSource").chart||{},s=o.getFromEnv("color-manager"),l=s.getColor("canvasBorderColor"),c=(0,a.pluckNumber)(r.showtoolbarbuttontooltext,1);n=(i=o.config).style,i.stepZoom=400/(100-(0,a.pluckNumber)(r.stepzoom,25)),i.stepZoom<=2&&(i.stepZoom=1.9),(0,a.extend2)(i,{useRoundEdges:(0,a.pluckNumber)(r.useroundedges,0),zoomType:"x",canvasPadding:(0,a.pluckNumber)(r.canvaspadding,0),scrollColor:(0,a.getFirstColor)((0,a.pluck)(r.scrollcolor,s.getColor("altHGridColor"))),scrollShowButtons:!!(0,a.pluckNumber)(r.scrollshowbuttons,1),scrollHeight:(0,a.pluckNumber)(r.scrollheight,16)||16,scrollBarFlat:(0,a.pluckNumber)(r.flatscrollbars,0),allowPinMode:(0,a.pluckNumber)(r.allowpinmode,1),skipOverlapPoints:(0,a.pluckNumber)(r.skipoverlappoints,1),showToolBarButtonTooltext:c,btnResetChartTooltext:c?(0,a.pluck)(r.btnresetcharttooltext,"Reset Chart"):"",btnZoomOutTooltext:c?(0,a.pluck)(r.btnzoomouttooltext,"Zoom out one level"):"",btnSwitchToZoomModeTooltext:c?(0,a.pluck)(r.btnswitchtozoommodetooltext,"<strong>Switch to Zoom Mode</strong><br/>Select a subset of data to zoom into it for detailed view"):"",btnSwitchToPinModeTooltext:c?(0,a.pluck)(r.btnswitchtopinmodetooltext,"<strong>Switch to Pin Mode</strong><br/>Select a subset of data and compare with the rest of the view"):"",pinPaneFill:(0,a.convertColor)((0,a.pluck)(r.pinpanebgcolor,l),(0,a.pluckNumber)(r.pinpanebgalpha,15)),zoomPaneFill:(0,a.convertColor)((0,a.pluck)(r.zoompanebgcolor,"#b9d5f1"),(0,a.pluckNumber)(r.zoompanebgalpha,30)),zoomPaneStroke:(0,a.convertColor)((0,a.pluck)(r.zoompanebordercolor,"#3399ff"),(0,a.pluckNumber)(r.zoompaneborderalpha,80)),showPeakData:(0,a.pluckNumber)(r.showpeakdata,0),maxPeakDataLimit:(0,a.pluckNumber)(r.maxpeakdatalimit,r.maxpeaklimit,null),minPeakDataLimit:(0,a.pluckNumber)(r.minpeakdatalimit,r.minpeaklimit,null),crossline:{enabled:(0,a.pluckNumber)(r.showcrossline,1),line:{"stroke-width":(0,a.pluckNumber)(r.crosslinethickness,1),stroke:(0,a.getFirstColor)((0,a.pluck)(r.crosslinecolor,"#000000")),"stroke-opacity":(0,a.pluckNumber)(r.crosslinealpha,20)/100},labelEnabled:(0,a.pluckNumber)(r.showcrosslinelabel,r.showcrossline,1),labelstyle:{fontSize:v(r.crosslinelabelsize)?v(r.crosslinelabelsize)+"px":n.outCanfontSize,fontSizeWithUnit:(0,a.pluckFontSizeMaintainUnit)(r.crosslinelabelsize,n.outCanfontSizeWithUnit),fontFamily:(0,a.pluck)(r.crosslinelabelfont,n.outCanfontFamily)},valueEnabled:(0,a.pluckNumber)(r.showcrosslinevalues,r.showcrossline,1),valuestyle:{fontSize:v(r.crosslinevaluesize)?v(r.crosslinevaluesize)+"px":n.inCanfontSize,fontSizeWithUnit:(0,a.pluckFontSizeMaintainUnit)(r.crosslinevaluesize,n.outCanfontSizeWithUnit),fontFamily:(0,a.pluck)(r.crosslinevaluefont,n.inCanvasStyle.fontFamily)}},useCrossline:(0,a.pluckNumber)(r.usecrossline,1),tooltipSepChar:(0,a.pluck)(r.tooltipsepchar,", "),showTerminalValidData:(0,a.pluckNumber)(r.showterminalvaliddata,0)})},n.getValuePixel=function(e){var t=this.config.viewPortConfig;return t.ddsi+E(e/t.ppp)},n.getDatasets=function(){var e=[];return this.iterateComponents((function(t){t.getType&&"dataset"===t.getType()&&e.push(t)})),e},n.__preDraw=function(){var e,t,n,i,o,r=this,s=r.config,l=r.getFromEnv("dataSource").chart,c=s.cdm,u=r.getChildren("xAxis")[0],d=s.viewPortConfig,h=s.crossline,p=r.getChildren("canvas")[0].config,g=C(p.canvasPadding,p.canvasPaddingLeft,p.canvasPaddingRight),f=r.getChildren("yAxis")[0],m=s.canvasHeight,v=r.getFromEnv("dataSource").chart,x=u.getTicksLen(),y=u.getVisibleConfig(),k=y.minValue,E=y.maxValue,w=(0,a.pluckNumber)(l.displaystartindex,k,1),M=(0,a.pluckNumber)(l.displayendindex,E,x||2),P=b(w,10)-1,L=b(M,10)-1,_=0;if(h.labelstyle.fontSize=this.computeFontSize(h.labelstyle.fontSizeWithUnit),h.valuestyle.fontSize=this.computeFontSize(h.valuestyle.fontSizeWithUnit),o=(i=r.getDatasets()).length,s.borderWidth=(0,a.pluckNumber)(v.showborder,1)?(0,a.pluckNumber)(v.borderthickness,1):0,s.updateAnimDuration=500,s.status="zoom",s.maxZoomLimit=(0,a.pluckNumber)(l.maxzoomlimit,1e3),s.viewPortHistory=[],(t=(0,a.pluckNumber)(l.pixelsperpoint,15))<1&&(t=1),(n=(0,a.pluckNumber)(l.pixelsperlabel,l.xaxisminlabelwidth,u.getAxisConfig("labels").rotation?20:60))<t&&(n=t),(P<0||P>=(x-1||1))&&(P=0),(L<=P||L>(x-1||1))&&(L=x-1||1),(d=s.viewPortConfig=(0,a.extend2)(s.viewPortConfig,{amrd:(0,a.pluckNumber)(l.anchorminrenderdistance,20),nvl:(0,a.pluckNumber)(l.numvisiblelabels,0),cdm:c,oppp:t,oppl:n,dsi:P,dei:L,vdl:L-P,clen:x,offset:0,step:1,llen:0,alen:0,ddsi:P,ddei:L,ppc:0})).clen){for(;o--;)e=i[o].config,_=C(_,e.drawanchors&&(e.anchorradius||0)+(Number(e.anchorborderthickness)||0)||0);s.overFlowingMarkerWidth=_,g=s.canvasPadding=C(_,g),s._prezoomed=d.dei-d.dsi<d.clen-1,s._visw=Math.max(1,s.canvasWidth-2*g),s._visx=s.canvasLeft+g,s._visout=-(s.height+m+1e3),s._yminValue=f.getLimit().min,s._ymin=f.getPixel(s._yminValue),(0,a.pluckNumber)(l.displaystartindex,l.displayendindex)&&u.setVisibleConfig(w,M),r.updateManager()}},n.resetZoom=function(){var e=this,t=e.config.viewPortHistory,n=t[0];return!!t.length&&(t.length=0,e.zoomTo(n.dsi,n.dei,n)&&e.fireChartInstanceEvent("zoomReset",e._zoomargs,[e.getFromEnv("chartInstance").id]),!0)},n.zoomOut=function(){var e,t,n,i,o,a=this,r=a.config,s=r.viewPortHistory;return e=s.pop(),t=s[0]||r.viewPortConfig,e?(n=e.dsi,i=e.dei):r._prezoomed&&(n=0,i=t.clen-1),(o=a.zoomTo(n,i,e))&&a.fireChartInstanceEvent("zoomedout",o),!0},n.zoomRangePixels=function(e,t){var n,i,o=this.config.viewPortConfig,a=o.ppp,r=o.ddsi;n=r+E(e/a),i=r+E(t/a),o.dsi=n,o.dei=i,this.updateManager()},n.prepareAttributes=function(){this.config.hasChartMessage||(this.__preDraw(),e.prototype.prepareAttributes.call(this))},n.getValue=function(e){var t=this,n=t.config,i=n.viewPortConfig,o=t.getOriginalPositions(e.x,e.y,e.x,e.y),a=o[0],r=o[1],s=t.getChildren("xAxis")[0],l=t.getChildren("yAxis")[0],c=s.config.axisRange,u=l.config.axisRange,d=c.min,h=c.max,p=u.max,g=u.min,f=n.canvasWidth*i.scaleX/(h-d),m=n.canvasHeight*i.scaleY/(p-g);return{x:d+(a-n.canvasLeft)/f,y:p-(r-n.canvasTop)/m}},n.getOriginalPositions=function(e,t,n,i){var o=this.config,a=o.viewPortConfig,r=a.scaleX,s=a.scaleY,l=a.x,c=a.y,u=y(e,n),d=C(e,n),h=y(t,i),p=C(t,i);return[l+(u=u<0?0:u)/r,c+(h=h<0?0:h)/s,((d=d>o.canvasWidth?o.canvasWidth:d)-u)/r,((p=p>o.canvasHeight?o.canvasHeight:p)-h)/s]},n.updateManager=function(){var e,t,n,i,o,a,r,s,l,c,u,d,h,p,g,f,m,b=this.getDatasets(),x=b.length,y=this.config,E=y.viewPortConfig,w=y._visw,M=this.getChildren("xAxis")[0],P=function(e){return M.getPixel(e,{wrtVisible:!0})},L=M.getAxisConfig("labels").style;if(y.legendClicked)for(e=0;e<x;e+=1)b[e].draw();else!E&&(E=y.viewPortConfig),o=E.oppp,f=E.nvl,d=E.dsi,h=E.dei,a=E.vdl=h-d,r=E.ppl=f?w/f:E.oppl,l=E.step=(s=E.ppp=w/a)<o?k(o/s):1,c=E.lskip=k(C(r,v(L.lineHeight))/s/l),p=E.dsi,g=E.dei,E.offset=0,u=E.norm=p%l,E.ddsi=p-=u,E.ddei=g=g+2*l-u,E._ymin=y._ymin,E._yminValue=y._yminValue,E.x=(P(p)-P(M.getVisibleConfig().minValue)+E.offset)/E.scaleX,g-p>M.getTicksLen()?E.scaleX=1:E.scaleX=M.getTicksLen()/Math.abs(g-p-l-.9),m=M.getVisibleConfig(),n=Math.ceil((m.maxValue-m.minValue+1)/f),i=y.viewPortConfig&&y.viewPortConfig.scaleX,t=Math.max(Math.round(M.getAxisConfig("labelStep")/i),f?n:c*l),M.setLabelConfig({step:t})},n.getParsedLabel=function(e){var t=this.xlabels;return t.parsed[e]||(t.parsed[e]=(0,a.parseUnsafeString)(t.data[e]||""))},n._setAxisScale=function(){this.setScrollType("always")},n.getDSdef=function(){return s["default"]},t}(r["default"]),L=P;t["default"]=L},1582:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o=i(n(288)),a=i(n(1576)),r=n(668),s=i(n(669)),l=i(n(1583)),c=function(e){function t(){var t;return(t=e.call(this)||this).getSpecificxAxisConf=r.getSpecificxAxisConf,t.getSpecificyAxisConf=r.getSpecificyAxisConf,t.registerFactory("axis",s["default"],["canvas"]),t.registerFactory("dataset",l["default"],["vCanvas"]),t}(0,o["default"])(t,e),t.getName=function(){return"ZoomLineDy"};var n=t.prototype;return n.getName=function(){return"ZoomLineDy"},n.__setDefaultConfig=function(){e.prototype.__setDefaultConfig.call(this);var t=this.config;t.friendlyName="Zoomable and Panable Multi-series Dual-axis Line Chart",t.defaultDatasetType="zoomline",t.isdual=!0,t.syncaxislimits=0},n._feedAxesRawData=function(){return r._feedAxesRawData.call(this)},t}(a["default"]);c.prototype.setAxisDimention=r.setAxisDimention;var u=c;t["default"]=u},1578:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o={"initial.dataset.zoomLine":i(n(619))["default"]["initial.dataset.line"]};t["default"]=o},1577:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o=i(n(288)),a=n(274),r=i(n(616)),s=n(282),l=i(n(1578)),c=a.hasTouch?a.TOUCH_THRESHOLD_PIXELS:a.CLICK_THRESHOLD_PIXELS;(0,s.addDep)({name:"zoomlineAnimation",type:"animationRule",extension:l["default"]});var u=function(e){function t(){return e.apply(this,arguments)||this}(0,o["default"])(t,e);var n=t.prototype;return n.getType=function(){return"dataset"},n.getName=function(){return"zoomLine"},n.__setDefaultConfig=function(){e.prototype.__setDefaultConfig.call(this),this.config.skipIgnorerIndices=[],this.config.showPeakData=0,this.config.showTerminalValidData=0,this.config.minPeakDataLimit=null,this.config.maxPeakDataLimit=null},n._plotConfigure=function(t,n,i){e.prototype._plotConfigure.call(this,t,n,i);var o=this,a=o.config,r=o.components.data[t].config.setValue,s=i||o.getFromEnv("xAxis").getTicksLen(),l=a.showTerminalValidData,c=a.showPeakData,u=a.maxPeakDataLimit,d=a.minPeakDataLimit;c&&(u<d&&(r>u&&r<d)||u>d&&(r>u||r<d))&&a.skipIgnorerIndices.push(t),l&&t===s-1&&a.skipIgnorerIndices.push(t)},n.drawPlots=function(){var t=this,n=t.getFromEnv("xAxis"),i=t.getFromEnv("chartConfig").viewPortConfig;n.getPixel(i.step)-n.getPixel(0)>=i.amrd?e.prototype.drawPlots.call(this):t.hideAllAnchors()},n._setConfigure=function(t,n){var i=this,o=i.config,r=i.getFromEnv("chart"),s=r.config,l=r.getFromEnv("dataSource").chart,c=i.config.JSONData;o.drawanchors=(0,a.pluckNumber)(l.drawanchors,l.showanchors,1),o.anchorradius=(0,a.pluckNumber)(c.anchorradius,l.anchorradius,o.linethickness+2),o.showTerminalValidData=(0,a.pluckNumber)(s.showTerminalValidData,0),o.showPeakData=(0,a.pluckNumber)(s.showPeakData,0),o.showPeakData&&(s.maxPeakDataLimit||s.minPeakDataLimit)&&(o.maxPeakDataLimit=(0,a.pluckNumber)(s.maxPeakDataLimit,Number.MIN_SAFE_INTEGER),o.minPeakDataLimit=(0,a.pluckNumber)(s.minPeakDataLimit,Number.MAX_SAFE_INTEGER)),e.prototype._setConfigure.call(this,t,n)},n.configureAttributes=function(t){e.prototype.configureAttributes.call(this,t);var n,i,o={},r=this.getFromEnv("chart").getFromEnv("dataSource").chart;n=(i=this.config).linethickness+(0,a.pluckNumber)(r.pinlinethicknessdelta,1),o["stroke-width"]=n>0&&n||0,o["stroke-dasharray"]=[3,2],o.stroke=(0,a.hashify)(i.linecolor),o["stroke-opacity"]=i.alpha/100,o["stroke-linejoin"]=i["stroke-linejoin"]="round",o["stroke-linecap"]=i["stroke-linecap"]="round",i.pin=o,i.animation=!1,i.transposeanimduration=0,i.defaultPadding={left:0,right:0}},n.drawLabel=function(){return this},n.isWithinShape=function(e,t,n,i){var o,r,s,l,u,d,h,p,g,f,m,v;if(e)return o=e.config.anchorProps,r=e.config,l=o.borderThickness,u=this.components.data,d=(0,a.pluckNumber)(r.dragTolerance,0),h=e._xPos,null!==(p=e._yPos)?(v=e.config.hoverEffects,s=Math.max(o.radius,v&&v.anchorRadius||0,c)+l/2,g=n-h,f=i-p,((m=Math.sqrt(Math.pow(g,2)+Math.pow(f,2)))<=s||m<=d)&&{pointIndex:t,hovered:!0,pointObj:u[t]}):void 0},n.hideAllAnchors=function(){var e,t,n,i=this.components.data;for(t=0,n=i.length;t<n;t++)(e=i[t])&&e.graphics&&e.graphics.element&&e.graphics.element.hide()},n._firePlotEvent=function(e,t,n){var i,o,a,r=this,s=r.getFromEnv("chart"),l=r.components.data,c=r.getFromEnv("toolTipController"),u=l[t],d=u.graphics.element,h=r.config.currentToolTip,p=!s.config.useCrossline;switch(a=(i=u.config).setLink,o=i.eventArgs,e){case"fc-mouseover":p&&r._decideTooltipType(t,n),r._rolloverResponseSetter(s,u,n),a&&(d.node.style.cursor="pointer");break;case"fc-mouseout":c.hide(h),r._rolloutResponseSetter(s,u,n),a&&(d.node.style.cursor="default");break;case"fc-click":s.plotEventHandler(d,n,"dataplotclick",o);break;case"fc-mousemove":p&&r._decideTooltipType(t,n)}},n.calculateScrollRange=function(){var e=this,t=e.config,n=e.getFromEnv("xAxis"),i=n.getTicksLen(),o=e.getFromEnv("chartConfig").viewPortConfig.step||1;t.scrollMinVal=Math.max(Math.round(n.getVisibleConfig().minValue),0)-o,t.scrollMaxVal=Math.min(Math.round(n.getVisibleConfig().maxValue)+1,i)+o,t.scrollMinValForLabel=Math.max(Math.round(n.getVisibleConfig().minValue),0)-o,t.scrollMaxValForLabel=Math.min(Math.round(n.getVisibleConfig().maxValue)+1,i)+o,t.scrollMinVal-=t.scrollMinVal%o,t.scrollMinValForLabel-=t.scrollMinValForLabel%o},t}(r["default"]),d=u;t["default"]=d},1579:(e,t,n)=>{t.__esModule=!0,t["default"]=function(e){var t,n,a,r,s,l,c,u,d=e.getFromEnv("dataSource"),h=d.chart||{},p=e.config,g=d.dataset,f=e.getChildren().canvas[0].getChildren("vCanvas")[0];p.cdm=t=(0,i.pluckNumber)(h.compactdatamode,0),p.cdmchar=n=(0,i.pluck)(h.dataseparator,o),g||e.setChartMessage();for(r=0;r<g.length;r++)if(a=g[r],t&&a.data&&a.data.split){for(s=[],l=0,u=(c=a.data.split(n)).length;l<u;l++)s.push({value:c[l]});a.data=s}(0,i.datasetFactory)(f,e.getDSdef(),"dataset",g.length,g),e.iterateComponents((function(e){e.getType&&"dataset"===e.getType()&&e.createPinElem&&e.addEventListener("createpinelements",e.createPinElem)}))};var i=n(274),o="|"},1583:(e,t,n)=>{t.__esModule=!0,t["default"]=function(e){var t,n,r,s,l,c,u,d,h,p=e.getFromEnv("dataSource"),g=p.chart||{},f=e.config,m=p.dataset,v=e.getChildren().canvas[0],b=[],x=[],C=[],y=[],k=v.getChildren("vCanvas");f.cdm=t=(0,i.pluckNumber)(g.compactdatamode,0),f.cdmchar=n=(0,i.pluck)(g.dataseparator,o),m||e.setChartMessage();for(s=0;s<m.length;s++)if(r=m[s],t&&r.data&&r.data.split){for(l=[],c=0,d=(u=r.data.split(n)).length;c<d;c++)l.push({value:u[c]});r.data=l}for(s=0;s<m.length;s++)"s"===((h=m[s]).parentyaxis||"").toLowerCase()?(y.push(h),x.push(s)):(C.push(h),b.push(s));C.length?(0,i.datasetFactory)(k[0],e.getDSdef(),"dataset_line",C.length,C,b):a(k[0]);y.length?(0,i.datasetFactory)(k[1],e.getDSdef(),"dataset_line",y.length,y,x):a(k[1]);e.iterateComponents((function(e){e.getType&&"dataset"===e.getType()&&e.createPinElem&&e.addEventListener("createpinelements",e.createPinElem)}))};var i=n(274),o="|",a=function(e){e&&e.iterateComponents((function(e){"dataset"===e.getType()&&e.remove()}))}},1584:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o,a,r,s,l=i(n(292)),c=i(n(288)),u=n(274),d=n(290),h=Math,p=h.max,g=h.min,f=0,m="ontouchstart"in window,v={zoomlinedy:!0,zoomline:!0},b=function(){this.remove()},x=function(){this.remove()},C=function(e,t,n){return n.getFromEnv("animationManager").setAnimation({el:"group",attr:{name:e},container:t,state:"appearing",component:n,label:"group"})},y=function(e){var t,n,i,o={},r=Number.POSITIVE_INFINITY;for(t=0;t<this.length;t++)i=(n=this[t]-e)<0?a.NEG:a.POS,(n=Math.abs(n))<=r&&(r=n,o.absValue=n,o.noScaleSide=i);return o},k=function(e){function t(){var t,n;return(t=e.call(this)||this).config.handlers=(n=(0,l["default"])(t),{onMouseOut:function(){n.hide(),n.position=o},onMouseMove:function(e){var t,i,o,a,r,s,l,c,d,h,p,g;n.disabled||n._mouseIsDown&&!m||(i=n.getZoomInfo(),o=n.getGraphicalElement("line"),a=i.step,s=(r=n.chart).getChildren("xAxis")[0],c=(l=r.get("config")).canvasLeft,d=(0,u.getMouseCoordinate)(n.getFromEnv("chart-container"),e,r).chartX,h=s.getVisibleConfig(),p=s.getAxisConfig("axisDimention").x-c,g=(g=n.getDataIndexFromPixel(Math.round(d)))+((t=g%a)>a/2?a-t:-t),d=s.getPixel(g,{wrtVisible:!0})-p-c,d-=i.offset,o.transform(["T",Math.round(d),0]),n.hidden&&0!==l.crossline.enabled&&n.show(),(g<h.minValue||g>h.maxValue)&&n.hide(),(g!==n.position||n.hidden)&&(n.position=g,n.lineX=d,n.updateLabels()))}}),t}(0,c["default"])(t,e);var n=t.prototype;return n.configureAttributes=function(e){this.config.options=e},n.draw=function(){var e,t,n,i,o,a,r,s,l={},c=this,d=c.getFromEnv("chart"),h=d.getFromEnv()["number-formatter"],p=d.config,g=c.left=d.getChildren("xAxis")[0].getAxisConfig("axisDimention").x,f=c.top=p.canvasTop,m=c.height=p.canvasHeight,v=c._visout=p._visout,y=[],k=c.getFromEnv("animationManager"),E=c.getGraphicalElement("line"),w=c.config.options,M=w.labelstyle,P=w.valuestyle,L=d.getChildren("yAxis")[0],_=L.getLimit(),S=d.getChildren("yAxis")[1],T=S&&S.getLimit(),F=c.getGraphicalElement("labels"),N=[],D=c.getGraphicalElement("positionLabel"),A=c.getLinkedParent().getChildContainer("crosslineBottom"),z=c.getLinkedParent().getChildContainer("crosslineTop");if(d.iterateComponents((function(e){e.getType&&"dataset"===e.getType()&&!e.getState("removed")&&y.push(e)})),c.plots=y,c.width=p._visw,o=c.group,(o=c.getContainer("valueGroup"))||(o=c.addContainer("valueGroup",C("crossline-value-group",z,c))),(s=c.getContainer("labelGroup"))||(s=c.addContainer("labelGroup",C("crossline-label-group",z,c))).insertBefore(d.getChildContainer("plotGroup")),c.container=A,o.attr({transform:["T",g,p._ymin]}).css(P),a=k.setAnimation({el:E||"path",container:A,doNotRemove:!0,attr:(0,u.extend2)({path:["M",g,f,"l",0,m]},w.line)}).toBack(),E||c.addGraphicalElement("line",a,!1),w.labelEnabled&&(l.x=v,l.y=f+m+(p.scrollHeight||0)+2.5,l["vertical-align"]="top",l.direction=p.textDirection,l.text=""),r=k.setAnimation({el:D||"text",attr:w.labelEnabled&&l,css:w.labelEnabled&&M,container:s,doNotRemove:!0,callback:!w.labelEnabled&&b}),!D&&w.labelEnabled&&c.addGraphicalElement("positionLabel",r,!1),c.hide(),c.ppixelRatio=-L.config.axisDimention.axisLength/L.getVisibleLength(),c.spixelRatio=S&&-S.config.axisDimention.axisLength/S.getVisibleLength(),c.yminValue=p._yminValue,c.pyaxisminvalue=_.min,c.pyaxismaxvalue=_.max,c.syaxisminvalue=T&&T.min,c.syaxismaxvalue=T&&T.max,c.positionLabels=p.xlabels||{data:[],parsed:[]},c.chart=d,e=0,w.valueEnabled){for(t=y.length;e<t;e+=1)n=y[e],i=(0,u.hashify)(n.config.linecolor),l.x=0,l.y=v,l.fill=i,l.direction=p.textDirection,l.text="",l["text-bound"]=P["text-bound"],l.lineHeight=P.lineHeight,N[e]=k.setAnimation({el:F&&F[e]||"text",container:o,doNotRemove:!0,attr:l}),(!F||!F[e])&&c.addGraphicalElement("labels",N[e],!0);c.numberFormatter=h}for(t=F&&F.length;e<t;e++)k.setAnimation({el:F[e],component:c,doNotRemove:!0,callback:x});F&&F.splice(y.length)},n.getType=function(){return"crossline"},n.getName=function(){return"crossLine"},n.getZoomInfo=function(){return this.getFromEnv("chartConfig").viewPortConfig},n.getDataIndexFromPixel=function(e){return Math.round(this.getFromEnv("chart").getChildren("xAxis")[0].getValue(e,{wrtVisible:!0}))},n.getPositionLabel=function(e){var t=this.getFromEnv("chart").getChildren("xAxis")[0].getLabel(e);return t&&t.label||""},n.disable=function(e){return e!==o&&(this.disabled=!!e,this.disabled&&this.visible&&this.hide()),this.disabled},n.updateLabels=function(){var e=this,t=e.getFromEnv("animationManager"),n=e.getGraphicalElement("labels"),i=e.getGraphicalElement("positionLabel"),l=e.plots,c=e.width,u=e.position,d=e.lineX,h=Math.floor(d),m=e.dummyText,v=e.numberFormatter,b=e.pyaxisminvalue,x=e.pyaxismaxvalue,C=e.syaxisminvalue,y=e.syaxismaxvalue,k=function(e){var t,n,i=e.getFromEnv("chart").getChildren("yAxis")[0].getPixel(e.yminValue),o=2,s={};a={},r=-1*e.height;try{Object.defineProperty(a,"POS",{enumerable:!1,configurable:!1,get:function(){return 1}}),Object.defineProperty(a,"NEG",{enumerable:!1,configurable:!1,get:function(){return-1}})}catch(l){a.POS=1,a.NEG=-1}try{Object.defineProperty(s,"top",{enumerable:!1,configurable:!1,get:function(){return r}}),Object.defineProperty(s,"bottom",{enumerable:!1,configurable:!1,get:function(){return i}})}catch(l){s.top=r,s.bottom=i}return s.init=function(e){var i,a=0;for(r+=(f=e+o)/2,n=Math.floor(Math.abs(r)/f),t=new w(n),i=0;i<n;i++)t.pos.push(a)},s.occupy=function(e,n){var i=Math.floor(Math.abs(r-e)/f);t&&t.attachShift(e,i,n)},s}(e);if(s=e._visout,n){m||(m=e.dummyText=e.getFromEnv("paper").text().hide()),m.attr({text:v.yAxis("0")}),m&&k.init(m.getBBox().height,n.length);var E=[];n.forEach((function(t,n){if(!l[n].getState("removed")){var i,a=l[n],r=a.components.data[u]&&a.components.data[u].config.setValue,c=a.config.parentYAxis;i=r===o||!a.getState("visible")||(c?r>y||r<C:r>x||r<b)?s:c?(r-C)*e.spixelRatio:(r-b)*e.ppixelRatio,E.push({value:r,labelYPos:i,label:t})}})),E.sort((function(e,t){return t.value-e.value})),E.forEach((function(e){k.occupy(e.labelYPos,e.label)}))}n&&n.forEach((function(n,i){if(!l[i].getState("removed")){var a,r,s,f,m,b,x=l[i],C=x.components.data[u]&&x.components.data[u].config.setValue,y=v[x.config.parentYAxis?"sYAxis":"yAxis"](C);y?(n.attr({text:y}),f=(s=(r=(a=n.getBBox())&&a.width)&&.5*r)&&s+10,b=n.calcY,m=p(0,g(h,c)),b!==o&&m!==o&&t.setAnimation({el:n,attr:{x:m,y:b,"text-anchor":(d<=f?"start":d+f>=c&&"end")||"middle","text-bound":["rgba(255,255,255,0.8)","rgba(0,0,0,0.2)",1,2.5]},doNotRemove:!0,component:e})):n.attr({x:-c})}})),i&&t.setAnimation({el:i,attr:{x:d+e.left,text:e.getPositionLabel(u),"text-bound":["rgba(255,255,255,1)","rgba(0,0,0,1)",1,2.5]},component:e})},n.show=function(){if(!this.disabled){this.hidden=!1;var e=this.getContainer("valueGroup"),t=this.getGraphicalElement("positionLabel"),n=this.getGraphicalElement("line");e&&e.show(),t&&t.show(),n&&n.show()}},n.hide=function(){this.hidden=!0;var e=this.getContainer("valueGroup"),t=this.getGraphicalElement("positionLabel"),n=this.getGraphicalElement("line");e&&e.hide(),t&&t.hide(),n&&n.hide()},n.dispose=function(){var e,t=this;for(e in t)t.hasOwnProperty(e)&&delete t[e]},t}(d.ComponentInterface);var E=function(){function e(){this.y=0,this.lRef=o,this.__shift=0,this.__index=0}var t=e.prototype;return t.applyShift=function(e){this.__shift=e,this.lRef.calcY=this.y+=e*f},t.applyDirectIndex=function(e){this.__index=e,this.lRef.calcY=this.y=r-e*f*-1},e}(),w=function(){function e(e){this.holes=[],this.pos=[];for(var t=0;t<e;t++)this.holes.push(t)}var t=e.prototype;return t.repositionHoles=function(){var e,t=0,n=this.pos;for(this.holes.length=0,e=0;e<n.length;e++)!n[e]&&(this.holes[t++]=e)},t.attachShift=function(e,t,n){var i,o,r,l,c,u,d,h=this.pos,p=h.length;if(e!==s){if(i=h[u=t>p-1?p-1:t],(l=new E).y=e,l.lRef=n,!i)return l.applyDirectIndex(u),h.splice(u,1,l),void this.holes.splice(this.holes.indexOf(u),1);if(o=u+(d=y.call(this.holes,u)).absValue*d.noScaleSide,d.noScaleSide===a.POS)return l.applyDirectIndex(o),h.splice(o,1,l),this.holes.splice(this.holes.indexOf(o),1),o;if(d.noScaleSide===a.NEG){for(r=h.splice(o+1,h.length-1),h.pop(),r.forEach((function(e){e&&e.applyShift(-1)})),[].push.apply(h,r),c=o;h[c];)c++;return h.push(0),this.repositionHoles(),c+=(d=y.call(this.holes,c)).absValue*d.noScaleSide,l.applyDirectIndex(c),h.splice(c,1,l),this.repositionHoles(),h.length-1}}else n.calcY=s},e}(),M={extension:function(e){e.addEventListener("instantiated",(function(e){if("canvas"===e.sender.getName()){var t,n,i,o=e.sender;o.registerFactory("crossLineManager-zoomline",(function(){var a,r=e.sender.getFromEnv("chart"),s=r&&r.getName();s&&v[s.toLowerCase()]&&((n=r.config.crossline)&&0!==n.enabled&&1===r.config.useCrossline?i=1:(n&&(n.enabled=0),i=0),(0,u.componentFactory)(o,k,"crossLine",i,[n]),i&&(a=o.getChildren("crossLine")[0],t=a.config.handlers,a.addExtEventListener("fc-mousemove",t.onMouseMove,o),a.addExtEventListener("fc-mouseover",t.onMouseMove,o),a.addExtEventListener("fc-dragstart",(function(e){t.onMouseOut(e),a.removeExtEventListener("fc-mousemove",t.onMouseMove,o)}),o),a.addExtEventListener("fc-dragend",(function(){a.addExtEventListener("fc-mousemove",t.onMouseMove,o)}),o),a.addExtEventListener("fc-mouseout",(function(e){t.onMouseOut(e)}),o)))}))}}))},name:"crossline-manager",type:"extension",requiresFusionCharts:!0};t["default"]=M},1575:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o=i(n(1576))["default"];t["default"]=o},1581:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o=i(n(1582))["default"];t["default"]=o},1574:(e,t,n)=>{var i=n(269);t.__esModule=!0,t["default"]=void 0;var o=i(n(1575));t.ZoomLine=o["default"];var a=i(n(1581));t.ZoomLineDY=a["default"];var r=i(n(1584)),s={name:"zoomline",type:"package",requiresFusionCharts:!0,extension:function(e){e.addDep(r["default"]),e.addDep(o["default"]),e.addDep(a["default"])}};t["default"]=s}}])}));
//# sourceMappingURL=http://localhost:3052/4.1.0/map/eval/fusioncharts.zoomline.js.map