(window.webpackJsonp=window.webpackJsonp||[]).push([[506],{3069:function(t,e,r){"use strict";r.r(e);r(4),r(8),r(23),r(25),r(40),r(31),r(17),r(5),r(41),r(43),r(32);var n=r(891);function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);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,h=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){h=!0,o=t},f:function(){try{c||null==r.return||r.return()}finally{if(h)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}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:"Mistura",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:1,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,e){var r=this.chartData.datasets;r[0].data=[];for(var n=1,o=0,l=t.length-1;l>=0;l--){var c=t[l],h=0;18===c.malha?h=1:20===c.malha?h=.8:30===c.malha?h=.6:50===c.malha?h=.3:80===c.malha&&(h=.18),h<n&&(n=h),h>o&&(o=h),r[0].data.push({x:h,y:c.passando})}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(e){var r=e.ctx,n=e.scales.x;if(void 0!==n){var l=e.scales.x.bottom;r.save(),r.beginPath();var c,h=o(t);try{for(h.s();!(c=h.n()).done;){var f=c.value,d=0;18===f.malha?d=n.getPixelForValue(1):20===f.malha?d=n.getPixelForValue(.8):30===f.malha?d=n.getPixelForValue(.6):50===f.malha?d=n.getPixelForValue(.3):80===f.malha&&(d=n.getPixelForValue(.18)),d&&(r.font="bold 10px Arial",r.fillStyle="#333333",r.fillText(f.malha,d-.5,l-.8))}}catch(t){h.e(t)}finally{h.f()}}r.lineWidth=1,r.stroke(),r.restore()}},this.options.plugins.tooltip.callbacks.footer=function(e){var r="";return e.forEach((function(e){var n,l=e.parsed.x,c=o(t);try{for(c.s();!(n=c.n()).done;){var h=n.value;if(h.valorAbertura===l){r=h.descricaoPeneira;break}}}catch(t){c.e(t)}finally{c.f()}})),r},this.baseChart=new n.f(this.chartCtx,{type:"line",data:this.chartData,options:this.options,plugins:[this.customAxis]})}},h=r(42),component=Object(h.a)(c,(function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"col-12"},[e("div",{staticStyle:{position:"relative",height:"70vh",width:"80vw"},attrs:{id:"chart-container"}},[e("canvas",{attrs:{id:"chart-granulometria"}})])])}],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=9f2aa31-1.2.11.js.map