var d0Ant=[[0,0.0961 ],[1,-0.1140 ],[2,-0.1247 ],[3,0.0675 ],[4,0.4569 ],[5,1.1767 ],[6,1.9201 ],[7,2.1009 ],[8,1.5572 ],[9,0.7703 ],[10,0.2393 ],[11,-0.0456 ],[12,-0.1099 ],[13,0.0550 ]]; var u0Ant=[[0,1.0000 ,1.],[1,1.0000 ,1.],[2,1.0000 ,1.],[3,1.0000 ,1.],[4,1.0000 ,1.],[4.755,1.0000 ,1.],[5,1.1767 ,1.],[6,1.9201 ,1.],[7,2.1009 ,1.],[8,1.5572 ,1.],[8.708,1.0000 ,1.],[9,1.0000 ,1.],[10,1.0000 ,1.],[11,1.0000 ,1.],[12,1.0000 ,1.],[13,1.0000 ,1.]]; var limUAnt=[[0,1.],[13,1.]]; var limLAnt=[[0,-1.],[13,-1.]]; var FechaAnt =[[4,"05"],[9,"10"],[14,"15
Setiembre 2023"],[19,"20"],[24,"25"],[29,"30"],[34,"05"],[39,"10"],[44,"15
Octubre 2023"],[49,"20"],[54,"25"],[59,"30"],[65,"05"],[70,"10"],[75,"15
Noviembre 2023"],[80,"20"],[85,"25"],[90,"30"]]; $(function() { $.plot("#placeSISAnt", [ { data: u0Ant, lines: { show: true, fill: true, fillColor: "rgb(0, 140, 0)" }, shadowSize: 0 }, { data: limUAnt, lines: { show: true, fill: false, }, shadowSize: 1, color: '#00ff00' }, { data: limLAnt, lines: { show: true, fill: false, }, shadowSize: 1, color: '#ffff00' }, { data: d0Ant, lines: { show: true, fill: false}, color: '#000000' }, { data: d0Ant, points: { show: true, radius: 2,symbol: 'circle' } , color: '#000000' }, ], { xaxis: { ticks: FechaAnt, font: { size: 8, family: 'verdana',style :'normal', color : 'black' }, }, yaxis: { min:-3, max: 3, ticks: ['-3','-2','-1','0','1','2','3'], font: { size: 8, family: 'verdana',style :'normal', color : 'black' } } , grid: { hoverable: true, clickable: true , autoHighlight: true, } } ); }); $('#placeSISAnt').bind('plothover', function (event, pos, item) { //alert('entre aca'); if (item) { if (previousPoint != item.datapoint) { previousPoint = item.datapoint; $('#tooltip').remove(); var x = item.datapoint[0].toFixed(0), y = item.datapoint[1].toFixed(2); sis=d0Ant[x]; showTooltip(item.pageX, item.pageY, 'sis= '+sis[1]+' std'); } } else { $('#tooltip').remove(); previousPoint = null; } }); var data1Ant; $(function() { // URL para recuperar la estacion var dataurlAnt = 'get_json.php?NEst=87097&FechaI=2023-09-01&FechaF=2023-11-30' ; console.log(dataurlAnt); // recuperamos la serie con jQuery function onDataReceivedAnt(serie) { console.log('entre en Ant'); data1Ant=serie.data; //alert(est[1].id); i=197; $('#TituloPPAnt').html( 'Precipitación (mm)
Est: '+est[i].id +' - "' + est[i].nom + '" / lat: '+est[i].lat+ ' / lon: '+est[i].lng+ ' / alt: '+est[i].alt +' m'); $.plot($('#preholderAnt'), [{data: serie.data,color:'blue'}], { bars: { show: true, align: 'center' }, crosshair: { mode: 'x' }, xaxis: { ticks: FechaAnt, font: { size: 8, family: 'verdana',style :'normal', color : 'black' }, }, yaxis: { min:0, max: 125, ticks : [0,25,50,75,100,125], font: { size: 8, family: 'verdana',style :'normal', color : 'black' } } , grid: { hoverable: true, clickable: true , autoHighlight: true, } }); }; $.ajax({ url: dataurlAnt, method: 'GET', async: false, dataType: 'json', success: onDataReceivedAnt, error: function (request, status, error) { //Muestra el error en caso de problemas alert(error) } }); $('#preholderAnt').bind('plothover', function (event, pos, item) { if (item) { if (previousPoint != item.datapoint) { previousPoint = item.datapoint; $('#tooltip').remove(); var x = item.datapoint[0].toFixed(0), y = item.datapoint[1].toFixed(2); pr=data1Ant[x]; console.log('pre '+pr[1]); showTooltip(item.pageX, item.pageY, 'pp= '+pr[1]+' mm'); } } else { $('#tooltip').remove(); previousPoint = null; } }); });