(window.webpackJsonp=window.webpackJsonp||[]).push([[503],{3068:function(t,r,e){"use strict";e.r(r);e(4),e(8),e(23),e(25),e(40),e(31),e(17),e(5),e(41),e(43),e(32);var n=e(891);function o(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(!t)return;if("string"==typeof t)return l(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return l(t,r)}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,c=!0,f=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return c=t.done,t},e:function(t){f=!0,o=t},f:function(){try{c||null==e.return||e.return()}finally{if(f)throw o}}}}function l(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,e=new Array(r);i<r;i++)e[i]=t[i];return e}n.f.register(n.j,n.m,n.i,n.e,n.k,n.l,n.h,n.p,n.q);var c={name:"ChartGranulometria",props:{granulometria:{type:Array,default:function(){return[]},required:!0}},data:function(){return{baseChart:{},chartCtx:null,customAxis:null,labelsAxis:[],chartData:{datasets:[{label:"Granulometria",data:[],backgroundColor:"#ff0000",hoverBackgroundColor:"#fff0",borderColor:"#ff0000"}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{position:"right"},title:{display:!0,text:"Distribuição Granulométrica",font:{size:14}},tooltip:{callbacks:{}}},scales:{x:{bounds:"ticks",display:!0,type:"logarithmic",min:.01,max:100,title:{display:!0,text:"Abertura (mm)"},ticks:{crossAlign:"center",major:{enabled:!0}}},y:{display:!0,min:0,max:100,title:{display:!0,text:"Passando (%)"}}}}}},watch:{granulometria:{deep:!0,handler:function(t,r){var e=this.chartData.datasets;e[0].data=[];for(var n=100,o=0,l=t.length-1;l>=0;l--){var c=t[l],f=c.valorAbertura;f<n&&(n=f),f>o&&(o=f),e[0].data.push({x:f,y:c.percPassando})}this.options.scales.x.min=n,this.options.scales.x.max=o,this.baseChart.update()}}},mounted:function(){this.chartCtx=document.getElementById("chart-granulometria");var t=this.granulometria;this.customAxis={id:"custom-axis-draw",beforeDraw:function(r){var e=r.ctx,n=r.scales.x;if(void 0!==n){var l=r.scales.x.bottom;e.save(),e.beginPath();var c,f=o(t);try{for(f.s();!(c=f.n()).done;){var d=c.value,h=n.getPixelForValue(d.valorAbertura);h&&(e.font="bold 10px Arial",e.fillStyle="#333333",e.fillText("fundo"!==d.descricaoPeneira.toLowerCase()?d.descricaoPeneira:"",h-12,l-18))}}catch(t){f.e(t)}finally{f.f()}}e.lineWidth=1,e.stroke(),e.restore()}},this.options.plugins.tooltip.callbacks.footer=function(r){var e="";return r.forEach((function(r){var n,l=r.parsed.x,c=o(t);try{for(c.s();!(n=c.n()).done;){var f=n.value;if(f.valorAbertura===l&&"fundo"!==f.descricaoPeneira.toLowerCase()){e=f.descricaoPeneira;break}}}catch(t){c.e(t)}finally{c.f()}})),e},this.baseChart=new n.f(this.chartCtx,{type:"line",data:this.chartData,options:this.options,plugins:[this.customAxis]})}},f=e(42),component=Object(f.a)(c,(function(){var t=this,r=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this.$createElement,r=this._self._c||t;return r("div",{staticClass:"col-12"},[r("div",{staticStyle:{position:"relative",height:"70vh",width:"80vw"},attrs:{id:"chart-container"}},[r("canvas",{attrs:{id:"chart-granulometria"}})])])}],!1,null,null,null);r.default=component.exports}}]);
//# sourceMappingURL=41467b2-1.2.11.js.map