I'm using Highcharts library to show values on a website. The xAxis
of my table is date and works fine on Firefox and Chrome, but isn't working on Safari browser.
I suspect the interpretation of the Date
object in JavaScript with Safari is different form other browsers.
¿Some hint?
This is my code:
<script>
myChart = new Highcharts.chart('containerTemperatura', {
title: {
text: 'Evolución de la Temperatura'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
minute: '%H:%M',
hour: '%H:%M'
}
},
yAxis: {
title: {
text: 'ºC'
}
},
series: [{
name: 'TEMPERATURA',
color: '#808080',
data:(function(){
var data = [];
<?php
for($i = 0; $i < count($ultimasLecturas); $i++){
?>
// EXAMPLE: $ultimasLecturas[$i]->fechaHora = "2017-08-12 12:34:04"
var $fecha = new Date("<?php echo $ultimasLecturas[$i]->fechaHora;?>");
// a compensation for different timezones
$fechaProcesada = $fecha.getTime() + <?php echo $UTCmilseg; ?>;
data.push([$fechaProcesada,<?php echo $ultimasLecturas[$i]->temperatura;?>]);
<?php
} ?>
return data;
})()
}]
});
</script>