MacdIndicator<T, D> constructor

MacdIndicator<T, D>({
  1. bool isVisible = true,
  2. String? xAxisName,
  3. String? yAxisName,
  4. String? seriesName,
  5. List<double> dashArray = const <double>[0, 0],
  6. double animationDuration = 1500,
  7. double animationDelay = 0,
  8. List<T>? dataSource,
  9. ChartValueMapper<T, D>? xValueMapper,
  10. ChartValueMapper<T, num>? closeValueMapper,
  11. String? name,
  12. bool isVisibleInLegend = true,
  13. LegendIconType legendIconType = LegendIconType.seriesType,
  14. String? legendItemText,
  15. Color signalLineColor = Colors.blue,
  16. double signalLineWidth = 2,
  17. int period = 14,
  18. int shortPeriod = 12,
  19. int longPeriod = 26,
  20. Color macdLineColor = Colors.orange,
  21. double macdLineWidth = 2,
  22. MacdType macdType = MacdType.both,
  23. Color histogramPositiveColor = Colors.green,
  24. Color histogramNegativeColor = Colors.red,
  25. ChartIndicatorRenderCallback? onRenderDetailsUpdate,
})

Creating an argument constructor of MacdIndicator class.

Implementation

MacdIndicator({
  super.isVisible,
  super.xAxisName,
  super.yAxisName,
  super.seriesName,
  super.dashArray,
  super.animationDuration,
  super.animationDelay,
  super.dataSource,
  ChartValueMapper<T, D>? xValueMapper,
  ChartValueMapper<T, num>? closeValueMapper,
  super.name,
  super.isVisibleInLegend,
  super.legendIconType,
  super.legendItemText,
  super.signalLineColor,
  super.signalLineWidth,
  this.period = 14,
  this.shortPeriod = 12,
  this.longPeriod = 26,
  this.macdLineColor = Colors.orange,
  this.macdLineWidth = 2,
  this.macdType = MacdType.both,
  this.histogramPositiveColor = Colors.green,
  this.histogramNegativeColor = Colors.red,
  super.onRenderDetailsUpdate,
}) : super(
        xValueMapper: xValueMapper != null && dataSource != null
            ? (int index) => xValueMapper(dataSource[index], index)
            : null,
        closeValueMapper: closeValueMapper != null && dataSource != null
            ? (int index) => closeValueMapper(dataSource[index], index)
            : null,
      );