效果图:
JS代码:
$(function(){$(document).ready(function(){highcharts.setoptions({global:{eututc:false}}); var chart; chart = new highcharts.chart({renderto: 'container'、type: 'spline」 {}}}、title:{text: 'live random data'}、xaxis:{type: 'datetime'、tickpixelinterval:150}、yaxis:[{title:{text: 'value'}、plotlines:[{value:0、width:1、coler: '#808080'} '}'}、 '}、'}、 ' [{value:0、width:1、color: '#808080'}]}]、tooltip:{formatter:function(){return '<b>' + thiseries.name + '</b> <br/>' + highcharts.dateformat( '%y-%m-%d%h: highcharts.numberformat(this.y、2); legent:{enabled:false}、{enabled:false}、series:[{name: 'and data:(function(){//ランダムデータvar data = []、time = []、time =(new date())。 data.push(x:time+i * 1000、y:math.random()}}}}}、 'and data:(function(){//ランダムデータvar data = []、time = []、new Date())。 X:I * 1000、y:math.random()}}); series.addpoint([x、y + 1]、true);HTML代码:
<head> <script type = "text/javascript" src = "js/jquery.min.js"> </script> <スクリプトタイプ= "text/javascript" src = "js/highcharts.js"> </scrip> <script type = "text/javascript" src = "js/exporting.js"> </script> </script> </head> <body> <div id = "container" style = "min-width:700px; height:400px"> </div> </body>
highcharts