Files
Chan/web/static/js/app/chart_tv.js
T
jackyu66gitandCursor 8ee11317d3 fix(web): 自动刷新保留 K 线视窗;威科夫与图表增量更新
自动刷新改用 tail update 与 scrollToPosition 恢复视窗,避免 setData 后跳到最右;拆分 chart_tv 模块并扩展 analyze/recent API。同步威科夫分析、pipeline 增量构建及相关策略与配置。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 22:57:43 +08:00

27 lines
684 B
JavaScript

/* chart_tv.js — facade: initTradingView orchestrates split modules */
function initTradingView(symbol, timeframe) {
try {
disposeTradingViewCharts();
console.log('初始化TradingView图表:', symbol, timeframe);
var ctx = {
symbol: symbol,
timeframe: timeframe
};
chartTvBuildShell(ctx);
if (!ctx.mainChart) {
return;
}
chartTvRenderIndicators(ctx);
chartTvRenderChan(ctx);
chartTvRenderOverlays(ctx);
chartTvFinalize(ctx);
console.log('图表初始化完成');
} catch (e) {
console.error('图表初始化错误:', e);
}
}