customizeSegment method

  1. @override
void customizeSegment(
  1. ChartSegment segment
)
override

To customize each segments.

Implementation

@override
void customizeSegment(ChartSegment segment) {
  if (segment is RadialBarSegment<T, D>) {
    updateSegmentColor(segment, borderColor, borderWidth);

    if (trackColor != Colors.transparent) {
      if (useSeriesColor) {
        segment.trackFillPaint.color =
            segment.fillPaint.color.withOpacity(trackOpacity);
      } else {
        segment.trackFillPaint.color = trackColor.withOpacity(trackOpacity);
      }
    } else {
      if (useSeriesColor) {
        segment.trackFillPaint.color = segment.fillPaint.color;
      } else {
        segment.trackFillPaint.color = trackColor;
      }
    }

    segment.trackStrokePaint
      ..color = trackBorderColor
      ..strokeWidth = trackBorderWidth;

    updateSegmentGradient(segment);
  }
}