下面是我创建的图表,我想在动态图表水平滚动时在右侧添加填充。
这是我将数据更新为图表的代码
setInterval(function(){updateChart()}, 100);
var updateChart = function () {
if(xVal > 160) return false;
chart.getDefaultAxisX().setInterval(xVal-100, xVal+2)
yVal = yVal + Math.round(5 + Math.random() *(-5-5));
series.add({ x: xVal, y: yVal})
seriestwo.add({ x: xVal, y: yVal+500})
xVal++;
// update chart after specified time.
};
在每次更新时,我都会调用这条线来实现我现在需要的。
chart.getDefaultAxisX().setInterval(xVal-100, xVal+2)
这有点晃动图表并且不平滑,我实际上如何添加填充,我正在检查所有文档,但没有找到任何东西。
你们可以在这里玩 - https://www.arction.com/lightningchart-js-interactive-examples/examples/lcjs-example-0150-ecg.html