ChartInteractionResult constructor
const
ChartInteractionResult({
- ChartDataPoint? point,
- PieData? segment,
- int? datasetIndex,
- int? elementIndex,
- bool isHit = false,
Creates a chart interaction result.
isHit defaults to false. Set to true when an element is found.
Either point or segment should be provided (not both).
Implementation
const ChartInteractionResult({
this.point,
this.segment,
this.datasetIndex,
this.elementIndex,
this.isHit = false,
}) : assert(
point == null || segment == null,
'Cannot have both point and segment',
),
assert(
!isHit || (point != null || segment != null),
'isHit true requires point or segment',
),
assert(
!isHit || datasetIndex != null,
'isHit true requires datasetIndex',
),
assert(
!isHit || elementIndex != null,
'isHit true requires elementIndex',
);