(window.webpackJsonp=window.webpackJsonp||[]).push([[505],{2122:function(t,o,e){"use strict";e.r(o);e(311);var n=e(891);n.f.register(n.n,n.j,n.m,n.i,n.e,n.k,n.l,n.h,n.p,n.q,n.o);var r={name:"ChartGranulometria",props:{elemento:{type:Array,default:function(){return[]},required:!0}},data:function(){return{baseChart:{},chartCtx:null,customAxis:null,chartData:{datasets:[{label:"",data:[],backgroundColor:"#007355",hoverBackgroundColor:"#fff0",borderColor:"#007355",tension:.4},{label:"",data:[],backgroundColor:"#4DB848",hoverBackgroundColor:"#fff0",borderColor:"#4DB848"}],labels:[1,2,3,4,5,6,7,8,9]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"right"},title:{display:!0,text:"Curva de Compactação",font:{size:14}},tooltip:{callbacks:{}}},scales:{x:{bounds:"ticks",display:!0,type:"linear",min:1,max:9,ticks:{crossAlign:"center",major:{enabled:!0}},title:{display:!0,text:"Umidade (%)"}},y:{display:!0,min:1.99,max:2.1,title:{display:!0,text:"Massa específica (g/cm³)"},ticks:{callback:function(t,o){return t},precision:3}}}}}},watch:{elemento:{deep:!0,handler:function(t){var o=this.chartData.datasets;o[0].data=[],o[1].data=[];for(var e=1;e<=5;e++){var n=t[0][0],r=t[0][1];if(void 0!==n&&void 0!==r){var c=n["cilindro".concat(e)]?n["cilindro".concat(e)]:null,l=r["cilindro".concat(e)]?r["cilindro".concat(e)]:null;o[0].data.push({x:c,y:l?l.toFixed(3):null})}}var d=t[1].massaEspecifica;if(void 0===d&&(d=0),d=d.toFixed(3),o[1].data.push({x:0,y:d}),o[1].data.push({x:t[1].umidadeOtima,y:d}),o[1].data.push({x:t[1].umidadeOtima,y:0}),t.length>0&&void 0!==t[0]&&void 0!==t[0][0]){this.options.scales.x.min=t[0][0].cilindro1-1,this.options.scales.x.max=t[0][0].cilindro5+1;var h=t[0][1],m=0,v=0;void 0!==h.cilindro1&&(m=h.cilindro1,v=h.cilindro1),void 0!==h.cilindro2&&m>h.cilindro2?m=h.cilindro2:void 0!==h.cilindro3&&m>h.cilindro3?m=h.cilindro3:void 0!==h.cilindro4&&m>h.cilindro4&&(m=h.cilindro4),void 0!==h.cilindro2&&v<h.cilindro2?v=h.cilindro2:void 0!==h.cilindro3&&v<h.cilindro3?v=h.cilindro3:void 0!==h.cilindro4&&v<h.cilindro4&&(v=h.cilindro4),"number"!=typeof m&&(m=0),"number"!=typeof v&&(v=0),this.options.scales.y.min=(m-.1).toFixed(3),this.options.scales.y.max=(v+.1).toFixed(3)}this.chartData.datasets=o,this.baseChart.update()}}},mounted:function(){this.chartCtx=document.getElementById("chart-serie-sequencia"),this.baseChart=new n.f(this.chartCtx,{type:"line",data:this.chartData,options:this.options})}},c=e(42),component=Object(c.a)(r,(function(){var t=this,o=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this.$createElement,o=this._self._c||t;return o("div",{staticClass:"col-12 d-flex justify-content-center align-items-center"},[o("div",{staticStyle:{position:"relative",height:"60vh",width:"60vw"},attrs:{id:"chart-container"}},[o("canvas",{attrs:{id:"chart-serie-sequencia"}})])])}],!1,null,null,null);o.default=component.exports}}]);
//# sourceMappingURL=0bcddd3-1.2.11.js.map