LineChartPainter constructor
LineChartPainter({
- required Color bgColor,
- required Color xAxisColor,
- required double xAxisWidth,
- 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,
- LineChartPointConfig? config,
- Offset? touchOffset,
- bool showYLineMark = false,
- double topPadding = 10,
- double startPadding = 10,
- double endPadding = 15,
- SelectedCallback? selectedCallback,
- List<
List< ? multipleLinePoints,LineChartPoint> > - List<
Color> ? multipleLinePointsColor, - List<
String> ? xLineMarks, - String? yUnit,
- bool useUnifyYUnit = false,
- bool unSelected = false,
Implementation
LineChartPainter({
required this.bgColor,
required this.xAxisColor,
required this.xAxisWidth,
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,
this.config,
this.touchOffset,
this.showYLineMark = false,
this.topPadding = 10,
this.startPadding = 10,
this.endPadding = 15,
this.selectedCallback,
this.multipleLinePoints,
this.multipleLinePointsColor,
this.xLineMarks,
this.yUnit,
this.useUnifyYUnit = false,
this.unSelected = 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!;
}
}