SimpleDensityChart constructor

const SimpleDensityChart({
  1. Key? key,
  2. required List<SimpleDensitySeries> series,
  3. SimpleTrendChartStyle style = SimpleTrendChartStyle.elegant,
  4. double? minValue,
  5. double? maxValue,
  6. double height = 260,
  7. EdgeInsets padding = _defaultPadding,
  8. List<Color>? palette,
  9. Color? lineColor,
  10. Color? fillColor,
  11. Color? meanColor,
  12. Color? medianColor,
  13. Color? rugColor,
  14. Color? gridColor,
  15. Color? axisColor,
  16. Color? activeColor,
  17. TextStyle? labelStyle,
  18. TextStyle? valueStyle,
  19. bool includeZero = false,
  20. bool showGrid = true,
  21. bool showLine = true,
  22. bool showArea = true,
  23. bool showRug = false,
  24. bool showValues = false,
  25. bool showLegend = true,
  26. bool showTooltip = true,
  27. bool showActiveSeries = true,
  28. bool showMean = false,
  29. bool showMedian = true,
  30. List<SimpleChartReferenceLine> referenceLines = const [],
  31. List<SimpleChartReferenceBand> referenceBands = const [],
  32. int gridLineCount = 4,
  33. int sampleCount = 96,
  34. double? strokeWidth,
  35. double? fillOpacity,
  36. double? rugHeight,
  37. SimpleDensityValueFormatter? valueFormatter,
  38. SimpleDensityValueFormatter? densityFormatter,
  39. SimpleDensityTapCallback? onSeriesTap,
  40. SimpleDensityTooltipBuilder? tooltipBuilder,
  41. WidgetBuilder? emptyBuilder,
  42. String? semanticLabel,
  43. bool excludeFromSemantics = false,
  44. Duration animationDuration = const Duration(milliseconds: 700),
  45. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleDensityChart({
  super.key,
  required this.series,
  this.style = SimpleTrendChartStyle.elegant,
  this.minValue,
  this.maxValue,
  this.height = 260,
  this.padding = _defaultPadding,
  this.palette,
  this.lineColor,
  this.fillColor,
  this.meanColor,
  this.medianColor,
  this.rugColor,
  this.gridColor,
  this.axisColor,
  this.activeColor,
  this.labelStyle,
  this.valueStyle,
  this.includeZero = false,
  this.showGrid = true,
  this.showLine = true,
  this.showArea = true,
  this.showRug = false,
  this.showValues = false,
  this.showLegend = true,
  this.showTooltip = true,
  this.showActiveSeries = true,
  this.showMean = false,
  this.showMedian = true,
  this.referenceLines = const [],
  this.referenceBands = const [],
  this.gridLineCount = 4,
  this.sampleCount = 96,
  this.strokeWidth,
  this.fillOpacity,
  this.rugHeight,
  this.valueFormatter,
  this.densityFormatter,
  this.onSeriesTap,
  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(sampleCount >= 12),
     assert(strokeWidth == null || strokeWidth > 0),
     assert(fillOpacity == null || (fillOpacity >= 0 && fillOpacity <= 1)),
     assert(rugHeight == null || rugHeight >= 0);