toPercentYCoord method

num toPercentYCoord([
  1. num? y,
  2. num? axis
])

Converts a y for an axis to a percentage from the top to the bottom of the drawing area.

If the coordinate represents a value visible on the canvas, then the value will be between 0 and 1, where 0 is the top of the canvas. However, this method will return values outside the range, as values can fall outside the canvas.

If y is null, this returns null. if axis is null, this uses the first axis.

Implementation

external num toPercentYCoord([num? y, num? axis]);