Session

MVC统计图自动增加节点

电脑版发表于:2021/4/23 17:24

报表中增加节点(chart)

                     events: {
                        load: function () {
                            //根据数据个数改变(没有数据就不能增加)
                            var servirs = this.series[0];
                            var servirs1 = this.series[1];
                            setInterval(function () {
                                servirs.addPoint(Math.round(Math.random() *10), true, true)
                                servirs1.addPoint(Math.round(Math.random() * 10), true, true)
                            }, 1000)
                        }
                    }
                    
                    
                    
                    //数据个数
                     series: [{
                                name: '温度',
                                color: '#89A54E',
                                type: 'line',
                                data: [6, 8, 2, 4, 5, 7, 8, 2, 4, 1, 4, 3, 4],
                                tooltip: {
                                valueSuffix: ' °C'
                               }
                               }, {
                                name: '湿度',
                                color: '#abcdef',
                                type: 'line',
                                data: [6, 8, 2, 4, 5, 7, 8, 2, 4, 1, 4, 3, 4],
                                tooltip: {
                                valueSuffix: ' °C'
                                }
                            }]


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢