highcharts的动态画曲线问题,官网上给了一个demo是随着时间的推移每秒随机生成一个点,最近头给我一个任务是,3分钟刷新一次然后有180个点,数据是后台传过来的,不知道怎么弄,希望有这方面经验的人给个建议。
------解决方案--------------------
如果是jquery就更简单了,highcharts对jquery的支持相当好。网上有很多不错的例子你搜索下。
参考下面几个步骤的思路:
首先画chart,注意先不加series:
$(document).ready(function() {
chart_answer = new Highcharts.Chart({
chart: {
backgroundColor: '#ffffff',
borderColor: '#a2a2a1',
borderWidth: 0,
borderRadius: 0,
renderTo: 'answer_time_chart',
type: 'area',
plotBackgroundColor: '#fffdf6'
},
colors: ['#3399FF'],
legend: {
enabled: false
},
title: {
text: ''
},
tooltip: {
borderRadius: 0,
borderWidth: 0,
shadow: false,
style: {
fontSize: '7pt',
color: '#000000'
},
formatter: function() {
return 'Time: ' + this.x + '
Time: ' + (this.y/60
------解决方案--------------------
0) + ':' + (this.y % 60 < 10 ? '0':'')+(this.y % 60); }
},
xAxis: {
labels: {
rotation: -45,
x: 0,
y: 40,
style: {
color: '#333333'