SimpleHistogramChart constructor

const SimpleHistogramChart({
  1. Key? key,
  2. List<double> values = const [],
  3. List<SimpleHistogramBin> bins = const [],
  4. int binCount = 8,
  5. SimpleHistogramScale scale = SimpleHistogramScale.count,
  6. SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
  7. double? minValue,
  8. double? maxValue,
  9. double height = 260,
  10. EdgeInsets padding = _defaultPadding,
  11. List<Color>? palette,
  12. Color? barColor,
  13. Color? curveColor,
  14. Color? meanColor,
  15. Color? medianColor,
  16. Color? gridColor,
  17. Color? axisColor,
  18. Color? activeBarColor,
  19. TextStyle? labelStyle,
  20. TextStyle? valueStyle,
  21. bool showGrid = true,
  22. bool showValues = true,
  23. bool showAxisLabels = true,
  24. bool showMean = true,
  25. bool showMedian = false,
  26. bool showDistributionCurve = false,
  27. bool showTooltip = true,
  28. bool showActiveBin = true,
  29. int gridLineCount = 4,
  30. double? barRadius,
  31. double? gapRatio,
  32. bool? useGradient,
  33. SimpleHistogramValueFormatter? valueFormatter,
  34. SimpleHistogramValueFormatter? countFormatter,
  35. SimpleHistogramValueFormatter? percentFormatter,
  36. SimpleHistogramTapCallback? onBinTap,
  37. SimpleHistogramTooltipBuilder? tooltipBuilder,
  38. WidgetBuilder? emptyBuilder,
  39. String? semanticLabel,
  40. bool excludeFromSemantics = false,
  41. Duration animationDuration = const Duration(milliseconds: 650),
  42. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleHistogramChart({
  super.key,
  this.values = const [],
  this.bins = const [],
  this.binCount = 8,
  this.scale = SimpleHistogramScale.count,
  this.style = SimpleBarChartStyle.elegant,
  this.minValue,
  this.maxValue,
  this.height = 260,
  this.padding = _defaultPadding,
  this.palette,
  this.barColor,
  this.curveColor,
  this.meanColor,
  this.medianColor,
  this.gridColor,
  this.axisColor,
  this.activeBarColor,
  this.labelStyle,
  this.valueStyle,
  this.showGrid = true,
  this.showValues = true,
  this.showAxisLabels = true,
  this.showMean = true,
  this.showMedian = false,
  this.showDistributionCurve = false,
  this.showTooltip = true,
  this.showActiveBin = true,
  this.gridLineCount = 4,
  this.barRadius,
  this.gapRatio,
  this.useGradient,
  this.valueFormatter,
  this.countFormatter,
  this.percentFormatter,
  this.onBinTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 650),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(binCount > 0),
     assert(height > 0),
     assert(gridLineCount >= 2),
     assert(barRadius == null || barRadius >= 0),
     assert(gapRatio == null || (gapRatio >= 0 && gapRatio < 0.8));