国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

highcharts動態圖表

2024-04-27 15:09:15
字體:
來源:轉載
供稿:網友
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script><script src="https://code.highcharts.com/highcharts.js"></script><script src="https://code.highcharts.com/modules/exporting.js"></script><div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

$(document).ready(function () {    Highcharts.setOptions({        global: {            useUTC: false        }    });    Highcharts.chart('container', {        chart: {            type: 'line',            animation: Highcharts.svg, // don't animate in old IE            marginRight: 10,            events: {                load: function () {                    // set up the updating of the chart each second                    var series = this.series[0];                    var series2 = this.series[1];                    setInterval(function () {                        var x = (new Date()).getTime(), // current time                            y = Math.random();                        series.addPoint([x, y], true, true);                        series2.addPoint([x-1, y-1], true, true);                    }, 1000);                }            }        },        title: {            text: 'Live random data'        },        xAxis: {            type: 'datetime',            tickPixelInterval: 150        },        yAxis: {            title: {                text: 'Value'            },            plotLines: [{                value: 0,                width: 1,                color: '#808080'            }]        },        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);            },            shared: false,            crosshairs: true,            plotOptions: {                /*spline: {                    marker: {                        radius: 4,                        lineColor: '#666666',                        lineWidth: 1,                        enabled: false                    }                },                */            }        },        legend: {            enabled: false        },        exporting: {            enabled: false        },        series: [{            name: 'Random data',            marker: {              enabled: false            },            data: (function () {                // generate an array of random data                var data = [],                    time = (new Date()).getTime(),                    i;                for (i = -19; i <= 0; i += 1) {                    data.push({                        x: time + i * 1000,                        y: Math.random()                    });                }                return data;            }())        },        {            name: 'Random data2',            marker: {              enabled: false            },            data: (function () {                // generate an array of random data                var data = [],                    time = (new Date()).getTime(),                    i;                for (i = -19; i <= 0; i += 1) {                    data.push({                        x: time + i * 1000,                        y: Math.random()                    });                }                return data;            }())        }        ]    });});


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 北川| 海林市| 衡山县| 建水县| 儋州市| 宝坻区| 蒙城县| 绍兴市| 高淳县| 台南市| 义马市| 南和县| 南雄市| 抚顺县| 洪湖市| 萨嘎县| 嘉定区| 苍梧县| 河西区| 五峰| 深泽县| 屯留县| 晋江市| 垦利县| 临安市| 阿拉善左旗| 揭东县| 甘孜县| 商丘市| 桃园市| 巴东县| 满城县| 莱阳市| 西安市| 枣强县| 齐齐哈尔市| 浮山县| 尉犁县| 岳普湖县| 义乌市| 新宾|