series.addPoint (对象选项,布尔重绘,布尔移位,混合动画)
chart: {
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.round(Math.random() * 100);
series.addPoint([x, y], true, false, true);
}, 1000);
}
}
},
xAxis: {
maxPadding: 1
}我想动态更新固定x轴范围内的数据,比如9:00到6:00,但是当重新绘制发生时,x轴中的最大值会增加,如何保持值不变?就像股票图表动态显示股票价格一样。
(http://finance.yahoo.com/echarts?s=FB+Interactive#symbol=fb;range=1d;compare=;indicator=volume;charttype=area;crosshair=on;ohlcvalues=0;logscale=off;source=undefined;)
我的代码:http://jsfiddle.net/cruelcage/ny43Z/
有人能帮我吗?
发布于 2013-09-26 07:57:57
您可以告诉高海图在y轴上绘制的最小值和最大值:
yAxis: {
min:0,
max:1,请参阅更新后的示例http://jsfiddle.net/2ghdH/。
Yoo也可以在x轴上做同样的事情:
var end = (new Date()).getTime()+100000;
xAxis: {
type: 'datetime',
tickPixelInterval: 150,
maxPadding :1.5,
max:end
},http://jsfiddle.net/nV8cu/
https://stackoverflow.com/questions/19022051
复制相似问题