$(function (){
$(document).ready(function () {
var ultimox;
var ultimoy;
$.ajax({
url: "conexion/conexion_temp.php",
type: 'get',
success: function(DatosRecuperados) {
$.each(DatosRecuperados, function(i,o){
if (o.x) {DatosRecuperados[i].x = parseInt(o.x);}
if (o.y) {DatosRecuperados[i].y = parseFloat(o.y);}
});
setx(DatosRecuperados[(DatosRecuperados.length)-1].x);
sety(DatosRecuperados[(DatosRecuperados.length)-1].y);
Highcharts.chart('container', {
chart: {
type: 'spline',
animation: Highcharts.svg, // don't animate in old IE
marginRight: 10,
events: {
load: function () {
series = this.series[0];
}
}
},
title: {
text: 'TEMPERATURA EN TIEMPO REAL'
},
xAxis: {
type: 'datetime',
tickPixelInterval: 200
},
yAxis: {
title: {
text: 'ESCALA'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
plotOptions: {
spline: {
dataLabels: {
enabled: true
},
enableMouseTracking: true
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
Highcharts.numberFormat(this.y, 2);
}
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
series: [{ name: 'Datos En VIVO', data: DatosRecuperados}]
});
}});
});
setInterval(function () {
$.get( "conexion/conexion_temp.php?Consultar=1", function( UltimosDatos ) {
var varlocalx=parseFloat(UltimosDatos[0].x);
var varlocaly=parseFloat(UltimosDatos[0].y);
if((getx()!=varlocalx)&&(gety()==varlocaly)){
series.addPoint([varlocalx, varlocaly], true, true);
setx(varlocalx);
sety(varlocaly);
}
});}, 1000); //delay
function getx(){return ultimox;}
function gety(){return ultimoy;}
function setx(x){ultimox=x;}
function sety(y){ultimoy=y;}
});
</script>
</div>
<div class="col-sm-4">.col-sm-4</div>
</div>
$(function (){
$(document).ready(function () {
var ultimox1;
var ultimoy1;
<!-- 1grafico $.ajax({-->
<div class="container" id="container" name="1" urlstyle="min-width: "conexion/conexion_hum.php",
400px; typeheight: 'get',
250px; successmargin: function(DatosRecuperados) {
$.each(DatosRecuperados,0 function(i,o){auto">
if (o.x) {DatosRecuperados[i].x =<div parseInt(o.x);}class="row">
if (o.y) {DatosRecuperados[i].y =<div parseFloat(o.y);}class="col-sm-4">
});<script>
$(function (){
setx(DatosRecuperados[ $(DatosRecuperados.lengthdocument)-1].xready(function (); {
var ultimox;
sety(DatosRecuperados[(DatosRecuperados.length)-1].y); var ultimoy;
Highcharts $.chartajax('container1', {
chart url: {"conexion/conexion_temp.php",
type: 'spline''get',
animationsuccess: Highcharts.svg, //function(DatosRecuperados) don't{
animate in old IE
marginRight:$.each(DatosRecuperados, 10function(i,o){
events: if (o.x) {
DatosRecuperados[i].x = parseInt(o.x);}
load: function () {
if (o.y) {DatosRecuperados[i].y = parseFloat(o.y);}
series = this.series[0];});
setx(DatosRecuperados[(DatosRecuperados.length)-1].x);
sety(DatosRecuperados[(DatosRecuperados.length)-1].y);
Highcharts.chart('container', {
chart: {
type: 'spline',
animation: Highcharts.svg, // don't animate in old IE
marginRight: 10,
events: {
load: function () {
series = this.series[0];
}
}
}
},
title: {
text: 'HUMEDAD EN TIEMPO REAL'
},
xAxis: {
type: 'datetime',
tickPixelInterval: 200
},
yAxis: {
title: {
text: 'ESCALA''TEMPERATURA EN TIEMPO REAL'
},
plotLinesxAxis: [{
value: 0,
widthtype: 1'datetime',
colortickPixelInterval: '#808080'200
}]
},
plotOptions: {
splineyAxis: {
dataLabelstitle: {
enabledtext: true'ESCALA'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
plotOptions: {
spline: {
dataLabels: {
enabled: true
},
enableMouseTracking: true
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
Highcharts.numberFormat(this.y, 2);
}
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
series: [{ name: 'Datos En VIVO', data: DatosRecuperados}]
});
}});
});
setInterval(function () {
$.get( "conexion/conexion_temp.php?Consultar=1", function( UltimosDatos ) {
var varlocalx=parseFloat(UltimosDatos[0].x);
var varlocaly=parseFloat(UltimosDatos[0].y);
if((getx()!=varlocalx)&&(gety()==varlocaly)){
series.addPoint([varlocalx, varlocaly], true, true);
setx(varlocalx);
sety(varlocaly);
}
},
legend: {
enabled: false
},
exporting: {
enabled: false
);},
series: [{ name: 'Datos En VIVO', data: DatosRecuperados}]
}1000); //delay
}});
});
setInterval(function getx() {
return ultimox;}
$.get( "conexion/conexion_hum.php?Consultar=1", function( UltimosDatos gety() {
return ultimoy;}
varfunction varlocalx1=parseFloatsetx(UltimosDatos[0].x);{ultimox=x;}
varfunction varlocaly1=parseFloatsety(UltimosDatos[0].y);{ultimoy=y;}
});
if((getx()!=varlocalx1)&&(gety()==varlocaly1)){</script>
</div>
<div class="col-sm-4">.col-sm-4</div>
</div>
</div>
series.addPoint([varlocalx1, varlocaly1],<!-- true,2grafico true);-->
<div class="container" id="container1" name="2" style="min-width: 400px; height: 250px; margin: 0 setx(varlocalx1);auto">
<div sety(varlocaly1);class="row">
<div }class="col-sm-4">
});}, 1000); //delay<script>
$(function getx(){return ultimox1;}
$(document).ready(function gety(){return ultimoy1;}{
function setx(x){ultimox1=x;} var ultimox1;
function sety(y){ultimoy1=y;} var ultimoy1;
$.ajax({
url: "conexion/conexion_hum.php",
type: 'get',
success: function(DatosRecuperados) {
$.each(DatosRecuperados, function(i,o){
if (o.x) {DatosRecuperados[i].x = parseInt(o.x);}
if (o.y) {DatosRecuperados[i].y = parseFloat(o.y);}
});
setx(DatosRecuperados[(DatosRecuperados.length)-1].x);
sety(DatosRecuperados[(DatosRecuperados.length)-1].y);
Highcharts.chart('container1', {
chart: {
type: 'spline',
animation: Highcharts.svg, // don't animate in old IE
marginRight: 10,
events: {
load: function () {
series = this.series[0];
}
}
},
title: {
text: 'HUMEDAD EN TIEMPO REAL'
},
xAxis: {
type: 'datetime',
tickPixelInterval: 200
},
yAxis: {
title: {
text: 'ESCALA'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
plotOptions: {
spline: {
dataLabels: {
enabled: true
},
enableMouseTracking: true
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
Highcharts.numberFormat(this.y, 2);
}
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
series: [{ name: 'Datos En VIVO', data: DatosRecuperados}]
});
}});
});
setInterval(function () {
$.get( "conexion/conexion_hum.php?Consultar=1", function( UltimosDatos ) {
var varlocalx1=parseFloat(UltimosDatos[0].x);
var varlocaly1=parseFloat(UltimosDatos[0].y);
if((getx()!=varlocalx1)&&(gety()==varlocaly1)){
series.addPoint([varlocalx1, varlocaly1], true, true);
setx(varlocalx1);
sety(varlocaly1);
}
});}, 1000); //delay
function getx(){return ultimox1;}
function gety(){return ultimoy1;}
function setx(x){ultimox1=x;}
function sety(y){ultimoy1=y;}
});
</script>
</div>
<div class="col-sm-4">.col-sm-4</div>
</div>
<div class="col-sm-4">.col-sm-4</div>
</div>