Skip to content

Commit

Permalink
opt: applyNewData reset axis
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Sep 22, 2024
1 parent f067cf5 commit 0919272
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,16 @@ 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
loadDataMore.backward = more
} else {
loadDataMore = { ...loadDataMore, ...more }
}

this._chartStore.addData(data, LoadDataType.Init, loadDataMore)
}

Expand Down

0 comments on commit 0919272

Please sign in to comment.