MainRenderer constructor
MainRenderer(
- Rect mainRect,
- double maxValue,
- double minValue,
- double topPadding,
- MainState state,
- bool isLine,
- int fixedLength,
- ChartStyle chartStyle,
- ChartColors chartColors,
- double scaleX,
- VerticalTextAlignment verticalTextAlignment, [
- List<
int> maDayList = const [5, 10, 20],
Implementation
MainRenderer(
Rect mainRect,
double maxValue,
double minValue,
double topPadding,
this.state,
this.isLine,
int fixedLength,
this.chartStyle,
this.chartColors,
this.scaleX,
this.verticalTextAlignment,
[this.maDayList = const [5, 10, 20]])
: 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);
}