MainRenderer constructor

MainRenderer(
  1. Rect mainRect,
  2. double maxValue,
  3. double minValue,
  4. double topPadding,
  5. List<MainIndicator> indicatorLi,
  6. bool isLine,
  7. int fixedLength,
  8. KChartStyle chartStyle,
  9. KChartColors chartColors,
  10. double scaleX,
  11. VerticalTextAlignment verticalTextAlignment,
  12. 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);
}