MainRenderer constructor
MainRenderer({})
Implementation
MainRenderer({
required this.style,
required super.chartRect,
required super.maxValue,
required super.minValue,
this.state = MainState.NONE,
this.isLine = false,
required this.scaleX,
this.maDayList = const [5, 10, 20],
super.dataFormat
}) : super(style: style) {
mLinePaint = Paint()
..isAntiAlias = true
..style = PaintingStyle.stroke
..strokeWidth = mLineStrokeWidth
..color = style.colors.kLine;
_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);
}