MainRenderer constructor
MainRenderer(
- Rect mainRect,
- double maxValue,
- double minValue,
- double topPadding,
- List<
MainIndicator> indicatorLi, - bool isLine,
- int fixedLength,
- KChartStyle chartStyle,
- KChartColors chartColors,
- double scaleX,
- VerticalTextAlignment verticalTextAlignment,
- double mBottomPadding,
Implementation
MainRenderer(
Rect mainRect,
double maxValue,
double minValue,
double topPadding,
this.indicatorLi,
this.isLine,
int fixedLength,
this.chartStyle,
this.chartColors,
this.scaleX,
this.verticalTextAlignment,
this.mBottomPadding,
) : super(
chartRect: mainRect,
maxValue: maxValue,
minValue: minValue,
topPadding: topPadding,
fixedLength: fixedLength,
gridColor: chartColors.gridColor,
) {
mCandleWidth = this.chartStyle.candleWidth;
mCandleLineWidth = this.chartStyle.candleLineWidth;
mLinePaint = Paint()
..isAntiAlias = true
..style = PaintingStyle.stroke
..strokeWidth = mLineStrokeWidth
..color = this.chartColors.kLineColor;
_contentRect = Rect.fromLTRB(
chartRect.left,
chartRect.top + _contentPadding,
chartRect.right,
chartRect.bottom - _contentPadding,
);
if (maxValue == minValue) {
maxValue *= 1.5;
minValue /= 2;
}
scaleY = _contentRect.height / (maxValue - minValue);
}