dataLabelSurfaceColor method

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

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:
      return super.dataLabelSurfaceColor(label);

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