layout method
layout API.
Implementation
@override
PwBox layout(Context context, BoxConstraints constraints) {
context.useText(title);
for (final ChartPoint p in points) {
context.useText(p.label);
if (showValues) {
context.useText(_chartValue(p.value));
}
}
return _ChartBox(
constraints.constrain(PwSize(width, height)),
type,
points,
title,
showValues: showValues,
showLegend: showLegend,
showGrid: showGrid,
);
}