forked from PhilJay/MPAndroidChart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransformerHorizontalBarChart.java
More file actions
44 lines (35 loc) · 1.25 KB
/
TransformerHorizontalBarChart.java
File metadata and controls
44 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.github.mikephil.charting.utils;
/**
* Transformer class for the HorizontalBarChart.
*
* @author Philipp Jahoda
*/
public class TransformerHorizontalBarChart extends Transformer {
public TransformerHorizontalBarChart(ViewPortHandler viewPortHandler) {
super(viewPortHandler);
}
/**
* Prepares the matrix that contains all offsets.
*
* @param chart
*/
public void prepareMatrixOffset(boolean inverted) {
mMatrixOffset.reset();
// offset.postTranslate(mOffsetLeft, getHeight() - mOffsetBottom);
if (!inverted)
mMatrixOffset.postTranslate(mViewPortHandler.offsetLeft(),
mViewPortHandler.getChartHeight() - mViewPortHandler.offsetBottom());
else {
mMatrixOffset
.setTranslate(
-(mViewPortHandler.getChartWidth() - mViewPortHandler.offsetRight()),
mViewPortHandler.getChartHeight() - mViewPortHandler.offsetBottom());
mMatrixOffset.postScale(-1.0f, 1.0f);
}
// mMatrixOffset.set(offset);
// mMatrixOffset.reset();
//
// mMatrixOffset.postTranslate(mOffsetLeft, getHeight() -
// mOffsetBottom);
}
}