为提升可读性,可将两个setTimeout的回调函数独立封装为函数,再调用
function hideScrollBar() {
_g().getWidgetByName('report2').setVScrollBarVisible(false);
}
function startMarquee() {
_g().getWidgetByName('report2').startMarquee({
offset: 5,
interval: 0.3,
stopOnHover: true,
to: 'top' // 根据需求选择'top'或'left'
});
}
setTimeout(hideScrollBar, 500);
setTimeout(startMarquee, 500); // 两个setTimeout的延迟时间可按需调整
代码需放置在报表的初始化后事件中,确保报表块对象已加载完成再执行