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.candleSeries =
      _currentSeriesDetails.series as CandleSeries<dynamic, dynamic>;
  _candelSeriesRenderer = SegmentHelper.getSegmentProperties(segment)
      .seriesRenderer as CandleSeriesRenderer;
  _candleSegment = _candelSeriesRenderer._candleSegment;
  final SegmentProperties segmentProperties =
      SegmentHelper.getSegmentProperties(_candleSegment);
  if (_currentSeriesDetails.candleSeries.enableSolidCandles! == true) {
    segmentProperties.isSolid = true;
    segmentProperties.color =
        _getCandleColor(_candleSegment, segmentProperties);
  } else {
    segmentProperties.isSolid = segmentProperties.isBull == false;
    segmentProperties.color =
        _getCandleColor(_candleSegment, segmentProperties);
  }
  segmentProperties.strokeWidth = segmentProperties.series.borderWidth;
}