customizeSegment method

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

Changes the series color, border color, and border width.

Implementation

@override
void customizeSegment(ChartSegment segment) {
  _currentSeriesDetails.hiloOpenCloseSeries =
      _currentSeriesDetails.series as HiloOpenCloseSeries<dynamic, dynamic>;
  final SegmentProperties segmentProperties =
      SegmentHelper.getSegmentProperties(segment);
  segmentProperties.color = _segmentSeriesDetails.seriesColor;
  segmentProperties.strokeColor =
      segment is HiloOpenCloseSegment && segmentProperties.isBull == true
          ? _currentSeriesDetails.hiloOpenCloseSeries.bullColor
          : _currentSeriesDetails.hiloOpenCloseSeries.bearColor;
  segmentProperties.strokeWidth = segmentProperties.series.borderWidth;
}