效果图:
JS 代码:
$ (function () {$ (เอกสาร) .ready (function () {highcharts.setOptions ({global: {useutc: false}}); var chart; chart = new highcharts.chart ({chart: {renderto: 'container', ประเภท: 'spline' function () {}}}, title: {text: 'Live Random Data'}, xaxis: {type: 'datetime', tickpixelinterval: 150}, yaxis: [{title: {text: 'value'}, plotlines: [{value: 0, width: 1, สี: plotlines: [{value: 0, width: 1, color: '#808080'}]}], tooltip: {formatter: function () {return '<b>' + this.series.name + '</b> <br/>' + highcharts.dateformat ( highcharts.numberformat (this.y, 2);}}, Legend: {enabled: false}, การส่งออก: {enabled: false}, series: [{ชื่อ: 'ข้อมูลสุ่ม', ข้อมูล: () {// สร้างอาร์เรย์ของข้อมูลแบบสุ่ม data.push ({x: time+i * 1000, y: math.random ()});} ส่งคืนข้อมูล; X: Time + I * 1000, y: math.random ()}); series.addpoint ([x, y + 1], true, true);html 代码:
<head> <script type = "text/javascript" src = "js/jQuery.min.js"> </script> <script type = "text/javascript" src = "js/highcharts.js"> </script> <script type = "javascript </script> </head> <body> <div id = "container" style = "min-width: 700px; ความสูง: 400px"> </div> </body>
以上这篇 highcharts 多个 y 轴动态刷新数据的实现代码, 希望能给大家一个参考,, 也希望大家多多支持武林网。