setData method

  1. @override
void setData(
  1. int index,
  2. ChartSegment segment
)
override

Implementation

@override
void setData(int index, ChartSegment segment) {
  super.setData(index, segment);
  final num open = openValues[index];
  final num close = closeValues[index];
  final bool isHollow = close > open;

  segment as CandleSegment<T, D>
    ..series = this
    ..currentSegmentIndex = index
    ..x = xValues[index]
    ..high = highValues[index]
    ..low = lowValues[index]
    ..open = open
    ..close = close
    ..top = isHollow ? close : open
    ..bottom = isHollow ? open : close
    ..isEmpty = isEmpty(index);
}