Highchart实时数据表 [英] Highchart live data gauge

查看:79
本文介绍了Highchart实时数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎对我的量表的实时数据有问题,它始终坚持在80.

代码在这里: http://pastebin.com/bysshBE0

Seem to have an issue with my live data for my gauge, it's pemanently stuck on 80.
Code is here: http://pastebin.com/bysshBE0

这是我的JSON数组:

This is my JSON array:


{HumOut:90,BatteryStatus:0,TempIn:21.27777777777778,
RainYear:2.8,HumIn:28,WindDir ,WindSpeed:0.0,
RainStorm:0.0,StormStartDate:2127-15-31,BatteryVolts:
4.751953125,Pressure:990.3826616999661,ForecastIcon:2 SunSet:16:21,ForecastRuleNo:122,BarTrend:60,
RainMonth:0.0,RainDay:0.0,TempOut:-1.7777777777777775,
WindSpeed10Min:0.0,SunRise:08:37,RainRate:0.0}

{"HumOut": 90, "BatteryStatus": 0, "TempIn": 21.27777777777778, "RainYear": 2.8, "HumIn": 28, "WindDir": 258, "WindSpeed": 0.0, "RainStorm": 0.0, "StormStartDate": "2127-15-31", "BatteryVolts": 4.751953125, "Pressure": 990.3826616999661, "ForecastIcon": 2, "SunSet": "16:21", "ForecastRuleNo": 122, "BarTrend": 60, "RainMonth": 0.0, "RainDay": 0.0, "TempOut": -1.7777777777777775, "WindSpeed10Min": 0.0, "SunRise": "08:37", "RainRate": 0.0}

在Chrome Debugger中没有任何javascript错误?

What is wrong, i dont have any javascript errors in Chrome Debugger?

推荐答案

function (chart) {
    setInterval(function() {
    $(function() {
    $.getJSON('livedata.php', function(data) {
        $.each(data, function(key,val) {
        if (key == 'WindSpeed')
        {
            newVal = val;
            var point = chart.series[0].points[0];
            point.update(newVal);
        }
        });
    });
    })
},3000)
})

这篇关于Highchart实时数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆