SimpleCyclePlotChart constructor

const SimpleCyclePlotChart({
  1. Key? key,
  2. required List<SimpleCyclePlotPoint> points,
  3. List<String> periodLabels = const [],
  4. List<String> cycleLabels = const [],
  5. SimpleTrendChartStyle style = SimpleTrendChartStyle.elegant,
  6. double? minValue,
  7. double? maxValue,
  8. double height = 250,
  9. EdgeInsets padding = _defaultPadding,
  10. List<Color>? palette,
  11. Color? lineColor,
  12. Color? averageLineColor,
  13. Color? fillColor,
  14. Color? gridColor,
  15. Color? axisColor,
  16. TextStyle? labelStyle,
  17. TextStyle? valueStyle,
  18. bool includeZero = false,
  19. bool showGrid = true,
  20. bool showDots = true,
  21. bool showValues = false,
  22. bool showArea = false,
  23. bool showLegend = true,
  24. bool showTooltip = true,
  25. bool showAverageLine = true,
  26. List<SimpleChartReferenceLine> referenceLines = const [],
  27. List<SimpleChartReferenceBand> referenceBands = const [],
  28. bool? smooth = false,
  29. double? strokeWidth,
  30. double? dotRadius,
  31. double? fillOpacity,
  32. int gridLineCount = 4,
  33. String averageLabel = 'Avg',
  34. SimpleCyclePlotValueFormatter? valueFormatter,
  35. SimpleCyclePlotTapCallback? onPointTap,
  36. SimpleCyclePlotTooltipBuilder? tooltipBuilder,
  37. WidgetBuilder? emptyBuilder,
  38. String? semanticLabel,
  39. bool excludeFromSemantics = false,
  40. Duration animationDuration = const Duration(milliseconds: 700),
  41. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleCyclePlotChart({
  super.key,
  required this.points,
  this.periodLabels = const [],
  this.cycleLabels = const [],
  this.style = SimpleTrendChartStyle.elegant,
  this.minValue,
  this.maxValue,
  this.height = 250,
  this.padding = _defaultPadding,
  this.palette,
  this.lineColor,
  this.averageLineColor,
  this.fillColor,
  this.gridColor,
  this.axisColor,
  this.labelStyle,
  this.valueStyle,
  this.includeZero = false,
  this.showGrid = true,
  this.showDots = true,
  this.showValues = false,
  this.showArea = false,
  this.showLegend = true,
  this.showTooltip = true,
  this.showAverageLine = true,
  this.referenceLines = const [],
  this.referenceBands = const [],
  this.smooth = false,
  this.strokeWidth,
  this.dotRadius,
  this.fillOpacity,
  this.gridLineCount = 4,
  this.averageLabel = 'Avg',
  this.valueFormatter,
  this.onPointTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 700),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(height > 0),
     assert(gridLineCount >= 2),
     assert(strokeWidth == null || strokeWidth > 0),
     assert(dotRadius == null || dotRadius >= 0),
     assert(fillOpacity == null || (fillOpacity >= 0 && fillOpacity <= 1));