setVisibleXRangeMaximum method

void setVisibleXRangeMaximum(
  1. double maxXRange
)

Limits how much of the x axis can be visible at once, so the user cannot zoom out further. Computed from the current x axis range, so call it after data is set. A range that is not above 0 does nothing.

maxXRange is the largest visible span in x values, for example 10 shows at most 10 units without scrolling.

Implementation

void setVisibleXRangeMaximum(double maxXRange) {
  final xScale = scaleForVisibleRange(xAxis.axisRange, maxXRange);
  if (xScale == null) return;
  viewPortHandler.setMinimumScaleX(xScale);
}