setScreenWidth method

void setScreenWidth(
  1. double width
)

Implementation

void setScreenWidth(double width) {
  screenWidth = width;
  int singleScreenCandleCount = getSingleScreenCandleCount(screenWidth);
  int maxCount = this.klineTotalList.length;
  int firstScreenNum =
      (getFirstScreenScale() * singleScreenCandleCount).toInt();
  if (singleScreenCandleCount > maxCount) {
    firstScreenNum = maxCount;
  }
  firstScreenCandleCount = firstScreenNum;

  getSubKlineList(0, firstScreenCandleCount ?? 0);
}