Sparkline constructor
Sparkline({
- Key? key,
- required List<
double> data, - double lineWidth = 1.0,
- Color lineColor = Colors.lightBlue,
- Gradient? lineGradient,
- PointsMode pointsMode = PointsMode.none,
- int? pointIndex,
- double pointSize = 4.0,
- Color pointColor = const Color(0xFF0277BD),
- bool sharpCorners = false,
- bool useCubicSmoothing = false,
- double cubicSmoothingFactor = 0.15,
- FillMode fillMode = FillMode.none,
- Color fillColor = const Color(0xFF81D4FA),
- Gradient? fillGradient,
- double fallbackHeight = 100.0,
- double fallbackWidth = 300.0,
- bool enableGridLines = false,
- String gridLinelabel(
- double gridLineValue
- Color gridLineColor = Colors.grey,
- int gridLineAmount = 5,
- double gridLineWidth = 0.5,
- Color gridLineLabelColor = Colors.grey,
- bool enableThreshold = false,
- double thresholdSize = 0.3,
- double? max,
- double? min,
- String gridLinelabelPrefix = "",
- int gridLineLabelPrecision = 3,
- bool averageLine = false,
- bool averageLabel = true,
- bool maxLine = false,
- bool maxLabel = true,
- List? kLine,
- Color? backgroundColor,
Creates a widget that represents provided data in a Sparkline chart.
Implementation
Sparkline({
Key? key,
required this.data,
this.lineWidth = 1.0,
this.lineColor = Colors.lightBlue,
this.lineGradient,
this.pointsMode = PointsMode.none,
this.pointIndex,
this.pointSize = 4.0,
this.pointColor = const Color(0xFF0277BD), //Colors.lightBlue[800]
this.sharpCorners = false,
this.useCubicSmoothing = false,
this.cubicSmoothingFactor = 0.15,
this.fillMode = FillMode.none,
this.fillColor = const Color(0xFF81D4FA), //Colors.lightBlue[200]
this.fillGradient,
this.fallbackHeight = 100.0,
this.fallbackWidth = 300.0,
this.enableGridLines = false,
this.gridLinelabel,
this.gridLineColor = Colors.grey,
this.gridLineAmount = 5,
this.gridLineWidth = 0.5,
this.gridLineLabelColor = Colors.grey,
// this.labelPrefix = "\$",
this.enableThreshold = false,
this.thresholdSize = 0.3,
this.max,
this.min,
this.gridLinelabelPrefix = "",
this.gridLineLabelPrecision = 3,
this.averageLine = false,
this.averageLabel = true,
this.maxLine = false,
this.maxLabel = true,
this.kLine,
this.backgroundColor,
}) : super(key: key);