Package 

Class Transformer


  • 
    public class Transformer
    
                        

    Transformer class that contains all matrices and is responsible for transforming values into pixels on the screen and backwards.

    • 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

      • pointValuesToPixel

         void pointValuesToPixel(Array<float> pts)

        Transform an array of points with all matrices. VERY IMPORTANT: Keepmatrix order "value-touch-offset" when transforming.

      • rectToPixelPhase

         void rectToPixelPhase(RectF r, float phaseY)

        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.

      • 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(...).

      • 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.