CartesianSeries<T, D> constructor

CartesianSeries<T, D>({
  1. ValueKey<String>? key,
  2. ChartIndexedValueMapper<D>? xValueMapper,
  3. ChartIndexedValueMapper? yValueMapper,
  4. ChartIndexedValueMapper<String>? dataLabelMapper,
  5. String? name,
  6. required List<T> dataSource,
  7. String? xAxisName,
  8. String? yAxisName,
  9. ChartIndexedValueMapper<num>? sizeValueMapper,
  10. ChartIndexedValueMapper<Color>? pointColorMapper,
  11. Color? color,
  12. String? legendItemText,
  13. ChartIndexedValueMapper? sortFieldValueMapper,
  14. LinearGradient? gradient,
  15. LinearGradient? borderGradient,
  16. double? width,
  17. ChartIndexedValueMapper<num>? highValueMapper,
  18. ChartIndexedValueMapper<num>? lowValueMapper,
  19. ChartIndexedValueMapper<bool>? intermediateSumPredicate,
  20. ChartIndexedValueMapper<bool>? totalSumPredicate,
  21. List<Trendline>? trendlines,
  22. SeriesRendererCreatedCallback? onRendererCreated,
  23. ChartSeriesRendererFactory<T, D>? onCreateRenderer,
  24. ChartPointInteractionCallback? onPointTap,
  25. ChartPointInteractionCallback? onPointDoubleTap,
  26. ChartPointInteractionCallback? onPointLongPress,
  27. CartesianShaderCallback? onCreateShader,
  28. MarkerSettings? markerSettings,
  29. bool? isVisible,
  30. bool? enableTooltip,
  31. EmptyPointSettings? emptyPointSettings,
  32. DataLabelSettings? dataLabelSettings,
  33. double? animationDuration,
  34. List<double>? dashArray,
  35. List<int>? initialSelectedDataIndexes,
  36. Color? borderColor,
  37. double? borderWidth,
  38. SelectionBehavior? selectionBehavior,
  39. bool? isVisibleInLegend,
  40. LegendIconType? legendIconType,
  41. double? opacity,
  42. double? animationDelay,
  43. SortingOrder? sortingOrder,
})

Creating an argument constructor of CartesianSeries class.

Implementation

CartesianSeries(
    {this.key,
    this.xValueMapper,
    this.yValueMapper,
    this.dataLabelMapper,
    this.name,
    required this.dataSource,
    this.xAxisName,
    this.yAxisName,
    this.sizeValueMapper,
    this.pointColorMapper,
    this.color,
    this.legendItemText,
    this.sortFieldValueMapper,
    this.gradient,
    this.borderGradient,
    this.width,
    this.highValueMapper,
    this.lowValueMapper,
    this.intermediateSumPredicate,
    this.totalSumPredicate,
    this.trendlines,
    this.onRendererCreated,
    this.onCreateRenderer,
    this.onPointTap,
    this.onPointDoubleTap,
    this.onPointLongPress,
    this.onCreateShader,
    MarkerSettings? markerSettings,
    bool? isVisible,
    bool? enableTooltip,
    EmptyPointSettings? emptyPointSettings,
    DataLabelSettings? dataLabelSettings,
    double? animationDuration,
    List<double>? dashArray,
    List<int>? initialSelectedDataIndexes,
    Color? borderColor,
    double? borderWidth,
    SelectionBehavior? selectionBehavior,
    bool? isVisibleInLegend,
    LegendIconType? legendIconType,
    double? opacity,
    double? animationDelay,
    SortingOrder? sortingOrder})
    : isVisible = isVisible ?? true,
      markerSettings = markerSettings ?? const MarkerSettings(),
      dataLabelSettings = dataLabelSettings ?? const DataLabelSettings(),
      enableTooltip = enableTooltip ?? true,
      emptyPointSettings = emptyPointSettings ?? EmptyPointSettings(),
      dashArray = dashArray ?? <double>[0, 0],
      assert(dashArray == null || dashArray.isNotEmpty,
          'The dashArray list must not be empty'),
      initialSelectedDataIndexes = initialSelectedDataIndexes ?? <int>[],
      animationDuration = animationDuration ?? 1500,
      borderColor = borderColor ?? Colors.transparent,
      selectionBehavior = selectionBehavior ?? SelectionBehavior(),
      legendIconType = legendIconType ?? LegendIconType.seriesType,
      isVisibleInLegend = isVisibleInLegend ?? true,
      borderWidth = borderWidth ?? 0,
      opacity = opacity ?? 1,
      animationDelay = animationDelay ?? 0,
      sortingOrder = sortingOrder ?? SortingOrder.none,
      super(
          name: name,
          xValueMapper: xValueMapper,
          yValueMapper: yValueMapper,
          sortFieldValueMapper: sortFieldValueMapper,
          pointColorMapper: pointColorMapper,
          dataLabelMapper: dataLabelMapper,
          dataSource: dataSource,
          emptyPointSettings: emptyPointSettings,
          dataLabelSettings: dataLabelSettings,
          enableTooltip: enableTooltip,
          animationDuration: animationDuration,
          selectionBehavior: selectionBehavior,
          legendIconType: legendIconType,
          sortingOrder: sortingOrder,
          animationDelay: animationDelay,
          opacity: opacity);