buildScene method
Builds the hit-test ChartScene for size. Implementations must derive it
from the same math used in ChartRenderer.draw, so the marks line up
with the pixels exactly.
Implementation
@override
ChartScene buildScene(Size size) {
if (points.length < 2) return ChartScene.empty;
final scale = _scaleFor(size);
return ChartScene(
bounds: scale.bounds,
scale: scale,
categories: [for (final p in points) p.label],
marks: [
for (var i = 0; i < points.length; i++)
PlotMark(
index: i,
seriesIndex: 0,
seriesName: '',
label: points[i].label,
value: points[i].value,
center: Offset(
scale.xForIndex(i),
scale.yForValue(drafterFinite(points[i].value)),
),
color: color,
),
],
);
}