LineChartPainter constructor

LineChartPainter()

Paints dataList into canvas, it is the animating LineChartData, targetData is the animation's target and remains the same during animation, then we should use it when we need to show tooltips or something like that, because dataList is changing constantly.

textScale used for scaling texts inside the chart, parent can use MediaQuery.textScaleFactor to respect the system's font size.

Implementation

LineChartPainter() : super() {
  _barPaint = Paint()..style = PaintingStyle.stroke;

  _barAreaPaint = Paint()..style = PaintingStyle.fill;

  _barAreaLinesPaint = Paint()..style = PaintingStyle.stroke;

  _clearBarAreaPaint = Paint()
    ..style = PaintingStyle.fill
    ..color = const Color(0x00000000)
    ..blendMode = BlendMode.dstIn;

  _touchLinePaint = Paint()
    ..style = PaintingStyle.stroke
    ..color = Colors.black;

  _bgTouchTooltipPaint = Paint()
    ..style = PaintingStyle.fill
    ..color = Colors.white;

  _borderTouchTooltipPaint = Paint()
    ..style = PaintingStyle.stroke
    ..color = Colors.transparent
    ..strokeWidth = 1.0;
}