calculateVisibleRange method
Calculates the visible range for an axis in chart.
Implementation
@override
void calculateVisibleRange(Size availableSize) {
_setOldRangeFromRangeController();
_visibleRange = _chartState._rangeChangeBySlider &&
_rangeMinimum != null &&
_rangeMaximum != null
? _VisibleRange(_rangeMinimum, _rangeMaximum)
: _VisibleRange(_actualRange!.minimum, _actualRange!.maximum);
_visibleRange!.delta = _actualRange!.delta;
_visibleRange!.interval = _actualRange!.interval;
bool canAutoScroll = false;
if (_categoryAxis.autoScrollingDelta != null &&
_categoryAxis.autoScrollingDelta! > 0 &&
!_chartState._isRedrawByZoomPan) {
canAutoScroll = true;
super._updateAutoScrollingDelta(_categoryAxis.autoScrollingDelta!, this);
}
if (!canAutoScroll &&
!(_chartState._rangeChangeBySlider &&
!_chartState._canSetRangeController)) {
_setZoomFactorAndPosition(this, _chartState._zoomedAxisRendererStates);
}
if (_zoomFactor < 1 ||
_zoomPosition > 0 ||
(_axis.rangeController != null && !_chartState._initialRender!)) {
_chartState._zoomProgress = true;
_calculateZoomRange(this, availableSize);
if (_axis.rangeController != null &&
_chartState._isRedrawByZoomPan &&
_chartState._canSetRangeController &&
_chartState._zoomProgress) {
_chartState._rangeChangedByChart = true;
_setRangeControllerValues(this);
}
}
_setZoomValuesFromRangeController();
}