dataLabelSurfaceColor method

  1. @override
Color dataLabelSurfaceColor(
  1. CartesianChartDataLabelPositioned label
)
override

Implementation

@override
Color dataLabelSurfaceColor(CartesianChartDataLabelPositioned label) {
  final ChartDataLabelAlignment alignment = label.labelAlignment;
  final ChartSegment segment = segments[label.dataPointIndex];
  switch (alignment) {
    case ChartDataLabelAlignment.auto:
    case ChartDataLabelAlignment.outer:
    case ChartDataLabelAlignment.middle:
    case ChartDataLabelAlignment.bottom:
      return _dataLabelSurfaceColor();

    case ChartDataLabelAlignment.top:
      return segment.getFillPaint().color;
  }
}