currentPriceRange property

PriceRange get currentPriceRange

Visible auto-scaled price range with vertical scale & pan applied.

Implementation

PriceRange get currentPriceRange {
  final candleList = _candleBuilder.candles;
  if (candleList.isEmpty) return const PriceRange(0.0, 1.0);
  final visible = _viewport.calculateVisibleIndices(candleList.length);
  final base = PriceRange.fromCandles(
    candleList,
    start: visible.start,
    end: visible.end,
  ).withPadding(topPaddingPercent: 0.08, bottomPaddingPercent: 0.08);

  return base.applyVerticalScaleAndPan(
    scale: _verticalScale,
    pan: _verticalPan,
  );
}