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 x1 = xValues[index];
  final num y1 = topValues[index];
  num x2 = double.nan;
  num y2 = double.nan;

  final int nextIndex = nextIndexConsideringEmptyPointMode(
      index, emptyPointSettings.mode, topValues, dataCount);
  if (nextIndex != -1) {
    x2 = xValues[nextIndex];
    y2 = topValues[nextIndex];
  }

  segment as StackedLineSegment<T, D>
    ..series = this
    .._x1 = x1
    .._y1 = y1
    .._x2 = x2
    .._y2 = y2
    ..isEmpty = isEmpty(index);
}