measureHorizontallyDrawnTicks method
Returns measurement of ticks drawn horizontally.
Implementation
@override
ViewMeasuredSizes measureHorizontallyDrawnTicks(
List<Tick<D>> ticks,
int maxWidth,
int maxHeight, {
bool collision = false,
}) {
final maxVerticalSliceWidth = ticks.fold(0, (prevMax, tick) {
final labelElements = splitLabel(tick.textElement!);
return max(
prevMax.toDouble(),
calculateHeightForRotatedLabel(
labelRotation(collision: collision),
getLabelHeight(labelElements),
getLabelWidth(labelElements),
),
//TODO: possible precision loss
).toInt();
});
return ViewMeasuredSizes(
preferredWidth: maxWidth,
preferredHeight: min(
maxHeight,
maxVerticalSliceWidth + labelOffsetFromAxisPx(collision: collision),
),
);
}