getPoint method

  1. @override
DatumPoint<D> getPoint(
  1. Object? datum,
  2. D? domainValue,
  3. D? domainLowerBoundValue,
  4. D? domainUpperBoundValue,
  5. ImmutableSeries<D> series,
  6. ImmutableAxis<D> domainAxis,
  7. num? measureValue,
  8. num? measureLowerBoundValue,
  9. num? measureUpperBoundValue,
  10. num? measureOffsetValue,
  11. ImmutableAxis<num> measureAxis,
)
override

Implementation

@override
DatumPoint<D> getPoint(
  Object? datum,
  D? domainValue,
  D? domainLowerBoundValue,
  D? domainUpperBoundValue,
  ImmutableSeries<D> series,
  ImmutableAxis<D> domainAxis,
  num? measureValue,
  num? measureLowerBoundValue,
  num? measureUpperBoundValue,
  num? measureOffsetValue,
  ImmutableAxis<num> measureAxis,
) {
  final domainPosition = domainAxis.getLocation(domainValue);

  final domainLowerBoundPosition = domainLowerBoundValue != null
      ? domainAxis.getLocation(domainLowerBoundValue)
      : null;

  final domainUpperBoundPosition = domainUpperBoundValue != null
      ? domainAxis.getLocation(domainUpperBoundValue)
      : null;

  final seriesKey = series.id;
  final seriesInfo = _seriesInfo[seriesKey]!;

  final measurePosition = _componentBounds.top + seriesInfo.symbolCenter;

  final measureLowerBoundPosition =
      domainLowerBoundPosition != null ? measurePosition : null;

  final measureUpperBoundPosition =
      domainUpperBoundPosition != null ? measurePosition : null;

  return DatumPoint<D>(
    datum: datum,
    domain: domainValue,
    series: series,
    x: domainPosition,
    xLower: domainLowerBoundPosition,
    xUpper: domainUpperBoundPosition,
    y: measurePosition,
    yLower: measureLowerBoundPosition,
    yUpper: measureUpperBoundPosition,
  );
}