zoom method
Implementation
ChartViewport zoom(
double factor, {
double centerX = 0.5,
double centerY = 0.5,
}) {
final cx = minX + width * centerX;
final cy = minY + height * centerY;
final newWidth = width / factor;
final newHeight = height / factor;
return ChartViewport(
minX: cx - newWidth * centerX,
maxX: cx + newWidth * (1 - centerX),
minY: cy - newHeight * centerY,
maxY: cy + newHeight * (1 - centerY),
);
}