fix(web): 分析/自动刷新后保留 K 线视窗位置

拆分手动分析与自动刷新拉数路径;全量重建用 logical 优先恢复视窗,
增量 recent 用 scroll+barDelta;避免 barSpacing 重锚与重复冻结导致往右跳。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-25 23:38:20 +08:00
co-authored by Cursor
parent 8ee11317d3
commit 90499533fb
8 changed files with 449 additions and 310 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ function saveMacdConfig() {
data: JSON.stringify({ fast: fast, slow: slow, signal: signal }),
success: function() {
hideMacdConfig();
updateChart();
analyzeChart({ reason: 'macd-config-saved' });
},
error: function() {
alert('保存MACD参数失败');
@@ -87,7 +87,7 @@ $(document).on('change', '#showMainStructureZone', function() {
console.log('结构区切换为:', on);
// 勾选后才向服务器请求多周期结构区数据;结构区叠层只在全量 init 里绘制,必须 incremental:false
if (on) {
updateChart({ incremental: false });
analyzeChart({ incremental: false, reason: 'structure-zone-on' });
} else {
updateChartDisplay();
}