Struct CoordinateTransformer<TX, TY>
Namespace: VelloSharp.Charting.Coordinates
Assembly: VelloSharp.Charting.dll
Converts between data domain coordinates and physical render units.
public readonly struct CoordinateTransformer<TX, TY>
Type Parameters
TX
TY
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
CoordinateTransformer(IScale<TX>, IScale<TY>, UnitRange, UnitRange, bool)
public CoordinateTransformer(IScale<TX> xScale, IScale<TY> yScale, UnitRange xRange, UnitRange yRange, bool invertY = true)
Parameters
xScale
IScale<TX>
yScale
IScale<TY>
xRange
UnitRange
yRange
UnitRange
invertY
bool
Methods
CreateForSize(IScale<TX>, IScale<TY>, double, double, bool)
public static CoordinateTransformer<TX, TY> CreateForSize(IScale<TX> xScale, IScale<TY> yScale, double width, double height, bool invertY = true)
Parameters
xScale
IScale<TX>
yScale
IScale<TY>
width
double
height
double
invertY
bool
Returns
CoordinateTransformer<TX, TY>
Project(TX, TY)
Projects a data point into physical coordinates.
public ChartPoint Project(TX x, TY y)
Parameters
x
TX
y
TY
Returns
ProjectX(TX)
Projects the X component only.
public double ProjectX(TX x)
Parameters
x
TX
Returns
ProjectY(TY)
Projects the Y component only.
public double ProjectY(TY y)
Parameters
y
TY
Returns
Unproject(double, double)
Unprojects a physical point back into data space.
public ChartDataPoint<TX, TY> Unproject(double x, double y)
Parameters
x
double
y
double
Returns
ChartDataPoint<TX, TY>