我试图创造一个流畅的情节。但是,我不确定要使用哪个绘图参数才能在底部的示例图像中获得结果。
我的阴谋在这里:
RandomSignalFlow
HTML:
<head>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="graph"></div>
</body>
JS:
function rand() {
return Math.random();
}
Plotly.plot('graph', [{
y: [1,2,3].map(rand),
mode: 'lines',
line: {color: '#80CAF6'}
}]);
var cnt = 0;
var interval = setInterval(function() {
Plotly.extendTraces('graph', {
y: [[rand()]]
}, [0])
if(cnt === 100) clearInterval(interval);
}, 300);
因此,这将创建数据流,但随着数据的流入,绘图将不断地水平压缩。我在追求
tracking
行为(如下图所示)。
我试着用
.shift()
裁剪数据的
X
和
Y
但由于某些原因,这些组件不起作用。
与图像关联的项目是
here
.