类似cpu趋势变化图表示例
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'spline',
marginRight: 10,
events: {
load: function() {
// set up the updating of the chart each second
var series = this.series[0];
setInterval(function() {
var x = (new Date()).getTime(), // current time
y = Math.random();
series.addPoint([x, y], true, true);
}, 1000);
}
}
},
title: {
text: 'Live random data',
style: {
margin: '10px 100px 0 0' // center it
}
},
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);
}
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
series: [{
name: 'Random data',
data: (function() {
// generate an array of random data
var data = [],
time = (new Date()).getTime(),
i;
for (i = -19; i <= 0; i++) {
data.push({
x: time + i * 1000,
y: Math.random()
});
}
return data;
})()
}]
});
});
技术讨论区(14 个讨论)
??盺
有没有详尽一些的用法啊
2018-4-20 16:15:29 | 回复
tthczl
GOOG,好用,效果不错
2018-1-12 17:09:41 | 回复
以温暖,簇拥你
特别好,什么类型的效果都有!
2017-6-7 17:50:22 | 回复
Khan
效果很好的插件
2017-2-17 8:44:18 | 回复
鈳以吥懓ωǒ
圆形饼状数据统计图表,感谢分享
2017-1-16 15:36:06 | 回复
/tp天边星辰
全全的,应有尽有~
2016-9-8 11:40:03 | 回复
WebCai
圆形饼状数据统计图表,不错
2016-7-17 17:01:18 | 回复
平常心
非常不错,感谢分享
2016-5-31 21:45:45 | 回复
小鸭快跑ˋωˊ
效果很不错,学习了
2016-4-29 10:40:15 | 回复
☆做自己╮
很好用,效果很好
2015-11-19 14:17:51 | 回复
发 布