LineChart constructor

LineChart({
  1. Key? key,
  2. Widget? child,
  3. bool useShader = true,
  4. required double lastClose,
  5. required String transformTime(
    1. int time
    ),
  6. double paddingTop = 0,
  7. Color lineColor = Colors.green,
  8. double strokeWidth = 1,
  9. Color gridLineColor = Colors.black12,
  10. double gridLineWidth = 0.5,
  11. int gridHorizontalGrids = 3,
  12. int gridVerticalGrids = 3,
  13. TextStyle gridUpperStyle = const TextStyle(color: Colors.red, fontSize: 8),
  14. TextStyle gridTextStyle = const TextStyle(color: Colors.black, fontSize: 8),
  15. TextStyle gridlowerStyle = const TextStyle(color: Colors.green, fontSize: 8),
  16. Color centralAxisColor = Colors.black12,
  17. TextStyle centralAxisStyle = const TextStyle(color: Colors.black45, fontSize: 8),
  18. TextStyle horizontalTextStyle = const TextStyle(color: Colors.black45, fontSize: 8),
  19. List<Color> maDayColors = const [Colors.yellow, Colors.blue, Colors.deepOrange, Colors.indigo],
  20. double maStrokeWidth = 0.5,
  21. Color averageLineColor = Colors.red,
  22. TextStyle crossLowerTextStyle = const TextStyle(fontSize: 8),
  23. TextStyle crossUpperTextStyle = const TextStyle(fontSize: 8),
  24. Color crossTextBgColor = Colors.green,
  25. Color crossTextBorderColor = Colors.black,
  26. Color crossLineColor = Colors.red,
  27. double crossLineWidth = 0.5,
  28. void onCrossChange(
    1. int index,
    2. 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");
}