-
public class TransformerTransformer class that contains all matrices and is responsible for transforming values into pixels on the screen and backwards.
-
-
Constructor Summary
Constructors Constructor Description Transformer(ViewPortHandler viewPortHandler)
-
Method Summary
Modifier and Type Method Description voidprepareMatrixValuePx(float xChartMin, float deltaX, float deltaY, float yChartMin)Prepares the matrix that transforms values to pixels. voidprepareMatrixOffset(boolean inverted)Prepares the matrix that contains all offsets. Array<float>generateTransformedValuesScatter(IScatterDataSet data, float phaseX, float phaseY, int from, int to)Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the SCATTERCHART. Array<float>generateTransformedValuesBubble(IBubbleDataSet data, float phaseY, int from, int to)Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the BUBBLECHART. Array<float>generateTransformedValuesLine(ILineDataSet data, float phaseX, float phaseY, int min, int max)Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the LINECHART. Array<float>generateTransformedValuesCandle(ICandleDataSet data, float phaseX, float phaseY, int from, int to)Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the CANDLESTICKCHART. voidpathValueToPixel(Path path)transform a path with all the given matrices VERY IMPORTANT: keep orderto value-touch-offset voidpathValuesToPixel(List<Path> paths)Transforms multiple paths will all matrices. voidpointValuesToPixel(Array<float> pts)Transform an array of points with all matrices. voidrectValueToPixel(RectF r)Transform a rectangle with all matrices. voidrectToPixelPhase(RectF r, float phaseY)Transform a rectangle with all matrices with potential animation phases. voidrectToPixelPhaseHorizontal(RectF r, float phaseY)voidrectValueToPixelHorizontal(RectF r)Transform a rectangle with all matrices with potential animation phases. voidrectValueToPixelHorizontal(RectF r, float phaseY)Transform a rectangle with all matrices with potential animation phases. voidrectValuesToPixel(List<RectF> rects)transforms multiple rects with all matrices voidpixelsToValue(Array<float> pixels)Transforms the given array of touch positions (pixels) (x, y, x, y, ...)into values on the chart. MPPointDgetValuesByTouchPoint(float x, float y)Returns a recyclable MPPointD instance.returns the x and y values in the chart at the given touch point(encapsulated in a MPPointD). voidgetValuesByTouchPoint(float x, float y, MPPointD outputPoint)MPPointDgetPixelForValues(float x, float y)Returns a recyclable MPPointD instance.Returns the x and y coordinates (pixels) for a given x and y value in the chart. MatrixgetValueMatrix()MatrixgetOffsetMatrix()MatrixgetValueToPixelMatrix()MatrixgetPixelToValueMatrix()-
-
Constructor Detail
-
Transformer
Transformer(ViewPortHandler viewPortHandler)
-
-
Method Detail
-
prepareMatrixValuePx
void prepareMatrixValuePx(float xChartMin, float deltaX, float deltaY, float yChartMin)
Prepares the matrix that transforms values to pixels. Calculates thescale factors from the charts size and offsets.
-
prepareMatrixOffset
void prepareMatrixOffset(boolean inverted)
Prepares the matrix that contains all offsets.
-
generateTransformedValuesScatter
Array<float> generateTransformedValuesScatter(IScatterDataSet data, float phaseX, float phaseY, int from, int to)
Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the SCATTERCHART.
-
generateTransformedValuesBubble
Array<float> generateTransformedValuesBubble(IBubbleDataSet data, float phaseY, int from, int to)
Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the BUBBLECHART.
-
generateTransformedValuesLine
Array<float> generateTransformedValuesLine(ILineDataSet data, float phaseX, float phaseY, int min, int max)
Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the LINECHART.
-
generateTransformedValuesCandle
Array<float> generateTransformedValuesCandle(ICandleDataSet data, float phaseX, float phaseY, int from, int to)
Transforms an List of Entry into a float array containing the x andy values transformed with all matrices for the CANDLESTICKCHART.
-
pathValueToPixel
void pathValueToPixel(Path path)
transform a path with all the given matrices VERY IMPORTANT: keep orderto value-touch-offset
-
pathValuesToPixel
void pathValuesToPixel(List<Path> paths)
Transforms multiple paths will all matrices.
-
pointValuesToPixel
void pointValuesToPixel(Array<float> pts)
Transform an array of points with all matrices. VERY IMPORTANT: Keepmatrix order "value-touch-offset" when transforming.
-
rectValueToPixel
void rectValueToPixel(RectF r)
Transform a rectangle with all matrices.
-
rectToPixelPhase
void rectToPixelPhase(RectF r, float phaseY)
Transform a rectangle with all matrices with potential animation phases.
-
rectToPixelPhaseHorizontal
void rectToPixelPhaseHorizontal(RectF r, float phaseY)
-
rectValueToPixelHorizontal
void rectValueToPixelHorizontal(RectF r)
Transform a rectangle with all matrices with potential animation phases.
-
rectValueToPixelHorizontal
void rectValueToPixelHorizontal(RectF r, float phaseY)
Transform a rectangle with all matrices with potential animation phases.
-
rectValuesToPixel
void rectValuesToPixel(List<RectF> rects)
transforms multiple rects with all matrices
-
pixelsToValue
void pixelsToValue(Array<float> pixels)
Transforms the given array of touch positions (pixels) (x, y, x, y, ...)into values on the chart.
-
getValuesByTouchPoint
MPPointD getValuesByTouchPoint(float x, float y)
Returns a recyclable MPPointD instance.returns the x and y values in the chart at the given touch point(encapsulated in a MPPointD). This method transforms pixel coordinates tocoordinates / values in the chart. This is the opposite method togetPixelForValues(...).
-
getValuesByTouchPoint
void getValuesByTouchPoint(float x, float y, MPPointD outputPoint)
-
getPixelForValues
MPPointD getPixelForValues(float x, float y)
Returns a recyclable MPPointD instance.Returns the x and y coordinates (pixels) for a given x and y value in the chart.
-
getValueMatrix
Matrix getValueMatrix()
-
getOffsetMatrix
Matrix getOffsetMatrix()
-
getValueToPixelMatrix
Matrix getValueToPixelMatrix()
-
getPixelToValueMatrix
Matrix getPixelToValueMatrix()
-
-
-
-