addPositionToDetailsForSeriesDatum method

  1. @override
DatumDetails<D> addPositionToDetailsForSeriesDatum(
  1. DatumDetails<D> details,
  2. SeriesDatum<D> seriesDatum
)
inherited

Adds chart position data to details.

This is a helper function intended to be called from getDetailsForSeriesDatum. Every concrete SeriesRenderer needs to implement custom logic for setting location data.

Implementation

@override
DatumDetails<D> addPositionToDetailsForSeriesDatum(
    DatumDetails<D> details, SeriesDatum<D> seriesDatum) {
  final bounds =
      _getRendererElement(seriesDatum.datum as TreeNode<Object>).boundingRect;
  final chartPosition = Point<double>(
      (isRtl ? bounds.left : bounds.right).toDouble(),
      (bounds.top + (bounds.height / 2)).toDouble());
  return DatumDetails.from(details,
      chartPosition: NullablePoint.from(chartPosition));
}