Skip to content

Commit f891a32

Browse files
committed
frontend: reinitialize chart when chart data length changed
Sometimes the chart was only half filled or not everything was displayed. This can happen if there is at least one rememebered wallet in combination with an unlocked wallet with different age, so that the length of the chart data changes. calling fitContent after setting the new data fixes this https://tradingview.github.io/lightweight-charts/docs/api/interfaces/ITimeScaleApi#fitcontent
1 parent 61ddaad commit f891a32

File tree

1 file changed

+1
-0
lines changed
  • frontends/web/src/routes/account/summary

1 file changed

+1
-0
lines changed

frontends/web/src/routes/account/summary/chart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class Chart extends Component<Props, State> {
118118
) {
119119
const data = this.state.source === 'hourly' ? chartDataHourly : chartDataDaily;
120120
this.lineSeries.setData(data);
121+
this.chart?.timeScale().fitContent();
121122
this.setFormattedData(data);
122123
}
123124

0 commit comments

Comments
 (0)