LineChart constructor
LineChart({
- Key? key,
- Widget? child,
- bool useShader = true,
- required double lastClose,
- required String transformTime(
- int time
- double paddingTop = 0,
- Color lineColor = Colors.green,
- double strokeWidth = 1,
- Color gridLineColor = Colors.black12,
- double gridLineWidth = 0.5,
- int gridHorizontalGrids = 3,
- int gridVerticalGrids = 3,
- TextStyle gridUpperStyle = const TextStyle(color: Colors.red, fontSize: 8),
- TextStyle gridTextStyle = const TextStyle(color: Colors.black, fontSize: 8),
- TextStyle gridlowerStyle = const TextStyle(color: Colors.green, fontSize: 8),
- Color centralAxisColor = Colors.black12,
- TextStyle centralAxisStyle = const TextStyle(color: Colors.black45, fontSize: 8),
- TextStyle horizontalTextStyle = const TextStyle(color: Colors.black45, fontSize: 8),
- List<
Color> maDayColors = const [Colors.yellow, Colors.blue, Colors.deepOrange, Colors.indigo], - double maStrokeWidth = 0.5,
- Color averageLineColor = Colors.red,
- TextStyle crossLowerTextStyle = const TextStyle(fontSize: 8),
- TextStyle crossUpperTextStyle = const TextStyle(fontSize: 8),
- Color crossTextBgColor = Colors.green,
- Color crossTextBorderColor = Colors.black,
- Color crossLineColor = Colors.red,
- double crossLineWidth = 0.5,
- void onCrossChange(
- int index,
- MainAxisAlignment alignment
Implementation
LineChart({
super.key,
super.child,
this.useShader = true,
required this.lastClose,
required this.transformTime,
this.paddingTop = 0,
this.lineColor = Colors.green,
this.strokeWidth = 1,
this.gridLineColor = Colors.black12,
this.gridLineWidth = 0.5,
this.gridHorizontalGrids = 3,
this.gridVerticalGrids = 3,
this.gridUpperStyle = const TextStyle(color: Colors.red, fontSize: 8),
this.gridTextStyle = const TextStyle(color: Colors.black, fontSize: 8),
this.gridlowerStyle = const TextStyle(color: Colors.green, fontSize: 8),
this.centralAxisColor = Colors.black12,
this.centralAxisStyle = const TextStyle(color: Colors.black45, fontSize: 8),
this.horizontalTextStyle =
const TextStyle(color: Colors.black45, fontSize: 8),
this.maDayColors = const [
Colors.yellow,
Colors.blue,
Colors.deepOrange,
Colors.indigo
],
this.maStrokeWidth = 0.5,
this.averageLineColor = Colors.red,
this.crossLowerTextStyle = const TextStyle(fontSize: 8),
this.crossUpperTextStyle = const TextStyle(fontSize: 8),
this.crossTextBgColor = Colors.green,
this.crossTextBorderColor = Colors.black,
this.crossLineColor = Colors.red,
this.crossLineWidth = 0.5,
this.onCrossChange,
}) {
assert(
gridHorizontalGrids != 0, "gridHorizontalGrids cannot be less than 1");
assert(gridVerticalGrids != 0, "gridVerticalGrids cannot be less than 1");
}