MainRenderer constructor

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