yAtPrice method

double yAtPrice(
  1. double price
)

Converts financial price to screen Y coordinate inside main pane.

Implementation

double yAtPrice(double price) {
  final chartWidth = (_viewport.viewportWidth - _priceAxisWidth).clamp(
    10.0,
    double.infinity,
  );
  final bounds = Rect.fromLTWH(0, 0, chartWidth, mainPaneHeight);
  return CoordinateConverter.priceToY(price, bounds, currentPriceRange);
}