public class Transformer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected android.graphics.Matrix |
mMatrixOffset
matrix for handling the different offsets of the chart
|
protected android.graphics.Matrix |
mMatrixValueToPx
matrix to map the values to the screen pixels
|
protected ViewPortHandler |
mViewPortHandler |
| Constructor and Description |
|---|
Transformer(ViewPortHandler viewPortHandler) |
| Modifier and Type | Method and Description |
|---|---|
float[] |
generateTransformedValuesBarChart(java.util.List<? extends Entry> entries,
int dataSet,
BarData bd,
float phaseY)
Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the BARCHART.
|
float[] |
generateTransformedValuesBubble(java.util.List<? extends Entry> entries,
float phaseX,
float phaseY,
int from,
int to)
Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the BUBBLECHART.
|
float[] |
generateTransformedValuesCandle(java.util.List<CandleEntry> entries,
float phaseX,
float phaseY,
int from,
int to)
Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the CANDLESTICKCHART.
|
float[] |
generateTransformedValuesHorizontalBarChart(java.util.List<? extends Entry> entries,
int dataSet,
BarData bd,
float phaseY)
Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the BARCHART.
|
float[] |
generateTransformedValuesLine(java.util.List<? extends Entry> entries,
float phaseX,
float phaseY,
int from,
int to)
Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the LINECHART.
|
float[] |
generateTransformedValuesScatter(java.util.List<? extends Entry> entries,
float phaseY)
Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the SCATTERCHART.
|
android.graphics.Matrix |
getOffsetMatrix() |
android.graphics.Matrix |
getPixelToValueMatrix() |
android.graphics.Matrix |
getValueMatrix() |
PointD |
getValuesByTouchPoint(float x,
float y)
Returns the x and y values in the chart at the given touch point
(encapsulated in a PointD).
|
android.graphics.Matrix |
getValueToPixelMatrix() |
void |
pathValuesToPixel(java.util.List<android.graphics.Path> paths)
Transforms multiple paths will all matrices.
|
void |
pathValueToPixel(android.graphics.Path path)
transform a path with all the given matrices VERY IMPORTANT: keep order
to value-touch-offset
|
void |
pixelsToValue(float[] pixels)
Transforms the given array of touch positions (pixels) (x, y, x, y, ...)
into values on the chart.
|
void |
pointValuesToPixel(float[] pts)
Transform an array of points with all matrices.
|
void |
prepareMatrixOffset(boolean inverted)
Prepares the matrix that contains all offsets.
|
void |
prepareMatrixValuePx(float xChartMin,
float deltaX,
float deltaY,
float yChartMin)
Prepares the matrix that transforms values to pixels.
|
void |
rectValuesToPixel(java.util.List<android.graphics.RectF> rects)
transforms multiple rects with all matrices
|
void |
rectValueToPixel(android.graphics.RectF r)
Transform a rectangle with all matrices.
|
void |
rectValueToPixel(android.graphics.RectF r,
float phaseY)
Transform a rectangle with all matrices with potential animation phases.
|
void |
rectValueToPixelHorizontal(android.graphics.RectF r)
Transform a rectangle with all matrices with potential animation phases.
|
void |
rectValueToPixelHorizontal(android.graphics.RectF r,
float phaseY)
Transform a rectangle with all matrices with potential animation phases.
|
protected android.graphics.Matrix mMatrixValueToPx
protected android.graphics.Matrix mMatrixOffset
protected ViewPortHandler mViewPortHandler
public Transformer(ViewPortHandler viewPortHandler)
public void prepareMatrixValuePx(float xChartMin,
float deltaX,
float deltaY,
float yChartMin)
xChartMin - deltaX - deltaY - yChartMin - public void prepareMatrixOffset(boolean inverted)
inverted - public float[] generateTransformedValuesScatter(java.util.List<? extends Entry> entries, float phaseY)
entries - public float[] generateTransformedValuesBubble(java.util.List<? extends Entry> entries, float phaseX, float phaseY, int from, int to)
entries - public float[] generateTransformedValuesLine(java.util.List<? extends Entry> entries, float phaseX, float phaseY, int from, int to)
entries - public float[] generateTransformedValuesCandle(java.util.List<CandleEntry> entries, float phaseX, float phaseY, int from, int to)
entries - public float[] generateTransformedValuesBarChart(java.util.List<? extends Entry> entries, int dataSet, BarData bd, float phaseY)
entries - dataSet - the dataset indexpublic float[] generateTransformedValuesHorizontalBarChart(java.util.List<? extends Entry> entries, int dataSet, BarData bd, float phaseY)
entries - dataSet - the dataset indexpublic void pathValueToPixel(android.graphics.Path path)
path - public void pathValuesToPixel(java.util.List<android.graphics.Path> paths)
paths - public void pointValuesToPixel(float[] pts)
pts - public void rectValueToPixel(android.graphics.RectF r)
r - public void rectValueToPixel(android.graphics.RectF r,
float phaseY)
r - phaseY - public void rectValueToPixelHorizontal(android.graphics.RectF r)
r - public void rectValueToPixelHorizontal(android.graphics.RectF r,
float phaseY)
r - phaseY - public void rectValuesToPixel(java.util.List<android.graphics.RectF> rects)
rects - public void pixelsToValue(float[] pixels)
pixels - public PointD getValuesByTouchPoint(float x, float y)
x - y - public android.graphics.Matrix getValueMatrix()
public android.graphics.Matrix getOffsetMatrix()
public android.graphics.Matrix getValueToPixelMatrix()
public android.graphics.Matrix getPixelToValueMatrix()