CandleSeries<T, D> constructor

CandleSeries<T, D>({
  1. ValueKey<String>? key,
  2. ChartSeriesRendererFactory<T, D>? onCreateRenderer,
  3. required List<T> dataSource,
  4. required ChartValueMapper<T, D> xValueMapper,
  5. required ChartValueMapper<T, num> lowValueMapper,
  6. required ChartValueMapper<T, num> highValueMapper,
  7. required ChartValueMapper<T, num> openValueMapper,
  8. required ChartValueMapper<T, num> closeValueMapper,
  9. ChartValueMapper<T, dynamic>? sortFieldValueMapper,
  10. ChartValueMapper<T, Color>? pointColorMapper,
  11. ChartValueMapper<T, String>? dataLabelMapper,
  12. SortingOrder? sortingOrder,
  13. String? xAxisName,
  14. String? yAxisName,
  15. String? name,
  16. Color? bearColor,
  17. Color? bullColor,
  18. bool? enableSolidCandles,
  19. EmptyPointSettings? emptyPointSettings,
  20. DataLabelSettings? dataLabelSettings,
  21. bool? isVisible,
  22. bool? enableTooltip,
  23. double? animationDuration,
  24. double? borderWidth,
  25. SelectionBehavior? selectionBehavior,
  26. bool? isVisibleInLegend,
  27. LegendIconType? legendIconType,
  28. String? legendItemText,
  29. List<double>? dashArray,
  30. double? opacity,
  31. double? animationDelay,
  32. SeriesRendererCreatedCallback? onRendererCreated,
  33. ChartPointInteractionCallback? onPointTap,
  34. ChartPointInteractionCallback? onPointDoubleTap,
  35. ChartPointInteractionCallback? onPointLongPress,
  36. CartesianShaderCallback? onCreateShader,
  37. List<int>? initialSelectedDataIndexes,
  38. bool? showIndicationForSameValues,
  39. List<Trendline>? trendlines,
})

Creating an argument constructor of CandleSeries class.

Implementation

CandleSeries({
  ValueKey<String>? key,
  ChartSeriesRendererFactory<T, D>? onCreateRenderer,
  required List<T> dataSource,
  required ChartValueMapper<T, D> xValueMapper,
  required ChartValueMapper<T, num> lowValueMapper,
  required ChartValueMapper<T, num> highValueMapper,
  required ChartValueMapper<T, num> openValueMapper,
  required ChartValueMapper<T, num> closeValueMapper,
  ChartValueMapper<T, dynamic>? sortFieldValueMapper,
  ChartValueMapper<T, Color>? pointColorMapper,
  ChartValueMapper<T, String>? dataLabelMapper,
  SortingOrder? sortingOrder,
  String? xAxisName,
  String? yAxisName,
  String? name,
  Color? bearColor,
  Color? bullColor,
  bool? enableSolidCandles,
  EmptyPointSettings? emptyPointSettings,
  DataLabelSettings? dataLabelSettings,
  bool? isVisible,
  bool? enableTooltip,
  double? animationDuration,
  double? borderWidth,
  SelectionBehavior? selectionBehavior,
  bool? isVisibleInLegend,
  LegendIconType? legendIconType,
  String? legendItemText,
  List<double>? dashArray,
  double? opacity,
  double? animationDelay,
  SeriesRendererCreatedCallback? onRendererCreated,
  ChartPointInteractionCallback? onPointTap,
  ChartPointInteractionCallback? onPointDoubleTap,
  ChartPointInteractionCallback? onPointLongPress,
  CartesianShaderCallback? onCreateShader,
  List<int>? initialSelectedDataIndexes,
  bool? showIndicationForSameValues,
  List<Trendline>? trendlines,
}) : super(
          key: key,
          onCreateRenderer: onCreateRenderer,
          name: name,
          onRendererCreated: onRendererCreated,
          onPointTap: onPointTap,
          onPointDoubleTap: onPointDoubleTap,
          onPointLongPress: onPointLongPress,
          dashArray: dashArray,
          xValueMapper: xValueMapper,
          lowValueMapper: lowValueMapper,
          highValueMapper: highValueMapper,
          // ignore: unnecessary_null_comparison
          openValueMapper: openValueMapper != null
              ? (int index) => openValueMapper(dataSource[index], index)
              : null,
          // ignore: unnecessary_null_comparison
          closeValueMapper: closeValueMapper != null
              ? (int index) => closeValueMapper(dataSource[index], index)
              : null,
          sortFieldValueMapper: sortFieldValueMapper,
          pointColorMapper: pointColorMapper,
          dataLabelMapper: dataLabelMapper,
          dataSource: dataSource,
          xAxisName: xAxisName,
          yAxisName: yAxisName,
          dataLabelSettings: dataLabelSettings,
          isVisible: isVisible,
          emptyPointSettings: emptyPointSettings,
          enableTooltip: enableTooltip,
          animationDuration: animationDuration,
          borderWidth: borderWidth ?? 2,
          selectionBehavior: selectionBehavior,
          legendItemText: legendItemText,
          isVisibleInLegend: isVisibleInLegend,
          legendIconType: legendIconType,
          sortingOrder: sortingOrder,
          opacity: opacity,
          animationDelay: animationDelay,
          onCreateShader: onCreateShader,
          bearColor: bearColor ?? Colors.red,
          bullColor: bullColor ?? Colors.green,
          enableSolidCandles: enableSolidCandles ?? false,
          initialSelectedDataIndexes: initialSelectedDataIndexes,
          showIndicationForSameValues: showIndicationForSameValues ?? false,
          trendlines: trendlines);