Skip to content

Commit

Permalink
fix: fix applyNewData([]) do not update. #410
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Apr 15, 2023
1 parent b4e9ca2 commit 36d522f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,11 @@ export default class ChartImp implements Chart {

applyNewData (dataList: KLineData[], more?: boolean): void {
this._chartStore.clearDataList()
this.applyMoreData(dataList, more)
if (dataList.length === 0) {
this.adjustPaneViewport(false, true, true, true)
} else {
this.applyMoreData(dataList, more)
}
}

applyMoreData (dataList: KLineData[], more?: boolean): void {
Expand Down

0 comments on commit 36d522f

Please sign in to comment.