LinePainter constructor
LinePainter({
- required Color bgColor,
- required Color xAxisColor,
- required double xAxisWidth,
- required List<
LineChartPoint> points, - Color lineColor = const Color(0xFF1678FF),
- Color? xLineTextColor,
- double lineWidth = 1,
- Color? yAxisColor,
- double? yAxisWidth,
- bool drawYAxis = false,
- int xLineNums = 1,
- bool showXLineText = false,
Implementation
LinePainter({
required this.bgColor,
required this.xAxisColor,
required this.xAxisWidth,
required this.points,
this.lineColor = const Color(0xFF1678FF),
this.xLineTextColor,
this.lineWidth = 1,
this.yAxisColor,
this.yAxisWidth,
this.drawYAxis = false,
this.xLineNums = 1,
this.showXLineText = false,
}) {
_bgRectPaint = Paint()..color = bgColor;
_xAxisPaint = Paint()
..color = xAxisColor
..strokeWidth = xAxisWidth;
xLineTextColor = xLineTextColor ?? xAxisColor;
if (drawYAxis) {
yAxisColor = yAxisColor ?? xAxisColor;
yAxisWidth = yAxisWidth ?? xAxisWidth;
_yAxisPaint = Paint()
..color = yAxisColor!
..strokeWidth = yAxisWidth!;
}
}