opt: applyNewData reset axis

This commit is contained in:
liihuu 2024-09-23 00:49:16 +08:00
parent f067cf5b96
commit 091927257b

View File

@ -665,6 +665,9 @@ export default class ChartImp implements Chart {
}
applyNewData (data: KLineData[], more?: boolean | Partial<LoadDataMore>): void {
this._drawPanes.forEach(pane => {
(pane.getAxisComponent() as AxisImp).setAutoCalcTickFlag(true)
})
let loadDataMore = { forward: false, backward: false }
if (isBoolean(more)) {
loadDataMore.forward = more
@ -672,7 +675,6 @@ export default class ChartImp implements Chart {
} else {
loadDataMore = { ...loadDataMore, ...more }
}
this._chartStore.addData(data, LoadDataType.Init, loadDataMore)
}