initRect method
init the rectangle box to draw chart
Implementation
void initRect(Size size) {
double volHeight = baseDimension.mVolumeHeight;
double secondaryHeight = baseDimension.mSecondaryHeight;
double mainHeight = mDisplayHeight;
mainHeight -= volHeight;
mainHeight -= (secondaryHeight * secondaryStateLi.length);
mMainRect = Rect.fromLTRB(0, mTopPadding, mWidth, mTopPadding + mainHeight);
if (volHidden != true) {
mVolRect = Rect.fromLTRB(0, mMainRect.bottom + mChildPadding, mWidth,
mMainRect.bottom + volHeight);
}
mSecondaryRectList.clear();
for (int i = 0; i < secondaryStateLi.length; ++i) {
mSecondaryRectList.add(RenderRect(
Rect.fromLTRB(
0,
mMainRect.bottom + volHeight + i * secondaryHeight + mChildPadding,
mWidth,
mMainRect.bottom +
volHeight +
i * secondaryHeight +
secondaryHeight),
));
}
}