%PDF- %PDF-
Direktori : /home/vacivi36/app/unidades/santos/dist/js/pages/chartist/ |
Current File : /home/vacivi36/app/unidades/santos/dist/js/pages/chartist/chartist-plugin-tooltip.min.js |
!function(e,o){"function"==typeof define&&define.amd?define(["chartist"],function(t){return e.returnExportsGlobal=o(t)}):"object"==typeof exports?module.exports=o(require("chartist")):e["Chartist.plugins.tooltips"]=o(Chartist)}(this,function(t){return function(m,h,y){"use strict";var t={currency:void 0,currencyFormatCallback:void 0,tooltipOffset:{x:0,y:-20},anchorToPoint:!1,appendToBody:!1,class:void 0,pointClass:"ct-point"};function o(t){var e=new RegExp("tooltip-show\\s*","gi");t.className=t.className.replace(e,"").trim()}function v(t,e){return-1<(" "+t.getAttribute("class")+" ").indexOf(" "+e+" ")}y.plugins=y.plugins||{},y.plugins.tooltip=function(g){return g=y.extend({},t,g),function(l){var t=g.pointClass;l instanceof y.Bar?t="ct-bar":l instanceof y.Pie&&(t=l.options.donut?"ct-slice-donut":"ct-slice-pie");var c=l.container,p=c.querySelector(".chartist-tooltip");p||((p=h.createElement("div")).className=g.class?"chartist-tooltip "+g.class:"chartist-tooltip",g.appendToBody?h.body.appendChild(p):c.appendChild(p));var f=p.offsetHeight,u=p.offsetWidth;function e(t,e,o){c.addEventListener(t,function(t){e&&!v(t.target,e)||o(t)})}function d(t){f=f||p.offsetHeight;var e,o,n=-(u=u||p.offsetWidth)/2+g.tooltipOffset.x,i=-f+g.tooltipOffset.y;if(g.appendToBody)p.style.top=t.pageY+i+"px",p.style.left=t.pageX+n+"px";else{var a=c.getBoundingClientRect(),r=t.pageX-a.left-m.pageXOffset,s=t.pageY-a.top-m.pageYOffset;!0===g.anchorToPoint&&t.target.x2&&t.target.y2&&(e=parseInt(t.target.x2.baseVal.value),o=parseInt(t.target.y2.baseVal.value)),p.style.top=(o||s)+i+"px",p.style.left=(e||r)+n+"px"}}o(p),e("mouseover",t,function(t){var e=t.target,o="",n=(l instanceof y.Pie?e:e.parentNode)?e.parentNode.getAttribute("ct:meta")||e.parentNode.getAttribute("ct:series-name"):"",i=e.getAttribute("ct:meta")||n||"",a=!!i,r=e.getAttribute("ct:value");if(g.transformTooltipTextFnc&&"function"==typeof g.transformTooltipTextFnc&&(r=g.transformTooltipTextFnc(r)),g.tooltipFnc&&"function"==typeof g.tooltipFnc)o=g.tooltipFnc(i,r);else{if(g.metaIsHTML){var s=h.createElement("textarea");s.innerHTML=i,i=s.value}if(i='<span class="chartist-tooltip-meta">'+i+"</span>",a)o+=i+"<br>";else if(l instanceof y.Pie){var c=function(t,e){for(;t=t.nextSibling,t&&!v(t,e););return t}(e,"ct-label");c&&(o+=function(t){return t.innerText||t.textContent}(c)+"<br>")}r&&(g.currency&&(r=null!=g.currencyFormatCallback?g.currencyFormatCallback(r,g):g.currency+r.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g,"$1,")),o+=r='<span class="chartist-tooltip-value">'+r+"</span>")}o&&(p.innerHTML=o,d(t),function(t){v(t,"tooltip-show")||(t.className=t.className+" tooltip-show")}(p),f=p.offsetHeight,u=p.offsetWidth)}),e("mouseout",t,function(){o(p)}),e("mousemove",null,function(t){!1===g.anchorToPoint&&d(t)})}}}(window,document,t),t.plugins.tooltips});