如何使用 highcharts 在实时图表上更改 xasis 的时间?

如何使用数据库中的时间设置轴和工具提示上的时间?


这是我的 dataPLLive.php


<?php


header("Content-type: text/json");


$servername = "....";

$username = ".....";

$password = ".....";

$dbname = "...."


$conn = mysqli_connect($servername, $username, $password, $dbname);

$query = mysqli_query($conn,   ("SELECT a.`JAM`, AVG(a.PacketLoss) AVG

                                FROM (

                                SELECT  `JAM`,`RNC`,`IPPATH_PM` AS PHB,`VS_IPPM_FORWORD_DROPMEANS` AS PacketLoss, `VSIPPMRttMeans` AS Latency, 'IPPM'

                                FROM `rnc_ippm_meas`

                                WHERE `JAM`>= CURDATE() AND `IPPATH_PM` LIKE '%AF31%'

                                UNION

                                SELECT `JAM`,`RNC`,`IPPOOL_PM`,`VSIPPOOLIPPMForwardDrop-Means`,`VSIPPOOLIPPMRttMeans`, 'IPPOOLPM'

                                FROM `rnc_ippool_ippm_meas` 

                                WHERE `JAM`>= CURDATE() AND `IPPOOL_PM` LIKE '%AF31%') a

                                GROUP BY a.`JAM`

                                LIMIT 10000"));


if (!$query) {

    printf("Error: %s\n", mysqli_error($conn));

    exit();

}

$arr = array();


while ($row = mysqli_fetch_assoc($query)) {   


    $value = $row['AVG'];

    $x = strtotime($row['JAM']) * 1000;

    $y = floatval($value);


    $arr[] = array($x, $y);


}

echo json_encode($arr);  

?>



这是输出Imgur,如果有人能解决这个问题,非常感谢,谢谢


BIG阳
浏览 139回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP