@@ -41,12 +41,12 @@ public HorizontalBarChartRenderer(BarDataProvider chart, ChartAnimator animator,
41
41
@ Override
42
42
public void initBuffers () {
43
43
44
- BarData barData = mChart .getBarData ();
45
- mBarBuffers = new HorizontalBarBuffer [barData .getDataSetCount ()];
44
+ BarData barData = chart .getBarData ();
45
+ barBuffers = new HorizontalBarBuffer [barData .getDataSetCount ()];
46
46
47
- for (int i = 0 ; i < mBarBuffers .length ; i ++) {
47
+ for (int i = 0 ; i < barBuffers .length ; i ++) {
48
48
IBarDataSet set = barData .getDataSetByIndex (i );
49
- mBarBuffers [i ] = new HorizontalBarBuffer (set .getEntryCount () * 4 * (set .isStacked () ? set .getStackSize () : 1 ),
49
+ barBuffers [i ] = new HorizontalBarBuffer (set .getEntryCount () * 4 * (set .isStacked () ? set .getStackSize () : 1 ),
50
50
barData .getDataSetCount (), set .isStacked ());
51
51
}
52
52
}
@@ -56,21 +56,21 @@ public void initBuffers() {
56
56
@ Override
57
57
protected void drawDataSet (Canvas c , IBarDataSet dataSet , int index ) {
58
58
59
- Transformer trans = mChart .getTransformer (dataSet .getAxisDependency ());
59
+ Transformer trans = chart .getTransformer (dataSet .getAxisDependency ());
60
60
61
- mBarBorderPaint .setColor (dataSet .getBarBorderColor ());
62
- mBarBorderPaint .setStrokeWidth (Utils .convertDpToPixel (dataSet .getBarBorderWidth ()));
61
+ barBorderPaint .setColor (dataSet .getBarBorderColor ());
62
+ barBorderPaint .setStrokeWidth (Utils .convertDpToPixel (dataSet .getBarBorderWidth ()));
63
63
64
64
final boolean drawBorder = dataSet .getBarBorderWidth () > 0.f ;
65
65
66
66
float phaseX = mAnimator .getPhaseX ();
67
67
float phaseY = mAnimator .getPhaseY ();
68
68
69
69
// draw the bar shadow before the values
70
- if (mChart .isDrawBarShadowEnabled ()) {
71
- mShadowPaint .setColor (dataSet .getBarShadowColor ());
70
+ if (chart .isDrawBarShadowEnabled ()) {
71
+ shadowPaint .setColor (dataSet .getBarShadowColor ());
72
72
73
- BarData barData = mChart .getBarData ();
73
+ BarData barData = chart .getBarData ();
74
74
75
75
final float barWidth = barData .getBarWidth ();
76
76
final float barWidthHalf = barWidth / 2.0f ;
@@ -100,24 +100,24 @@ protected void drawDataSet(Canvas c, IBarDataSet dataSet, int index) {
100
100
mBarShadowRectBuffer .left = mViewPortHandler .contentLeft ();
101
101
mBarShadowRectBuffer .right = mViewPortHandler .contentRight ();
102
102
103
- c .drawRect (mBarShadowRectBuffer , mShadowPaint );
103
+ c .drawRect (mBarShadowRectBuffer , shadowPaint );
104
104
}
105
105
}
106
106
107
107
// initialize the buffer
108
- BarBuffer buffer = mBarBuffers [index ];
108
+ BarBuffer buffer = barBuffers [index ];
109
109
buffer .setPhases (phaseX , phaseY );
110
110
buffer .setDataSet (index );
111
- buffer .setInverted (mChart .isInverted (dataSet .getAxisDependency ()));
112
- buffer .setBarWidth (mChart .getBarData ().getBarWidth ());
111
+ buffer .setInverted (chart .isInverted (dataSet .getAxisDependency ()));
112
+ buffer .setBarWidth (chart .getBarData ().getBarWidth ());
113
113
114
114
buffer .feed (dataSet );
115
115
116
116
trans .pointValuesToPixel (buffer .buffer );
117
117
118
118
final boolean isCustomFill = dataSet .getFills () != null && !dataSet .getFills ().isEmpty ();
119
119
final boolean isSingleColor = dataSet .getColors ().size () == 1 ;
120
- final boolean isInverted = mChart .isInverted (dataSet .getAxisDependency ());
120
+ final boolean isInverted = chart .isInverted (dataSet .getAxisDependency ());
121
121
122
122
if (isSingleColor ) {
123
123
mRenderPaint .setColor (dataSet .getColor ());
@@ -156,24 +156,24 @@ protected void drawDataSet(Canvas c, IBarDataSet dataSet, int index) {
156
156
157
157
if (drawBorder ) {
158
158
c .drawRect (buffer .buffer [j ], buffer .buffer [j + 1 ], buffer .buffer [j + 2 ],
159
- buffer .buffer [j + 3 ], mBarBorderPaint );
159
+ buffer .buffer [j + 3 ], barBorderPaint );
160
160
}
161
161
}
162
162
}
163
163
164
164
@ Override
165
165
public void drawValues (Canvas c ) {
166
166
// if values are drawn
167
- if (isDrawingValuesAllowed (mChart )) {
167
+ if (isDrawingValuesAllowed (chart )) {
168
168
169
- List <IBarDataSet > dataSets = mChart .getBarData ().getDataSets ();
169
+ List <IBarDataSet > dataSets = chart .getBarData ().getDataSets ();
170
170
171
171
final float valueOffsetPlus = Utils .convertDpToPixel (5f );
172
172
float posOffset = 0f ;
173
173
float negOffset = 0f ;
174
- final boolean drawValueAboveBar = mChart .isDrawValueAboveBarEnabled ();
174
+ final boolean drawValueAboveBar = chart .isDrawValueAboveBarEnabled ();
175
175
176
- for (int i = 0 ; i < mChart .getBarData ().getDataSetCount (); i ++) {
176
+ for (int i = 0 ; i < chart .getBarData ().getDataSetCount (); i ++) {
177
177
178
178
IBarDataSet dataSet = dataSets .get (i );
179
179
if (dataSet .getEntryCount () == 0 ) {
@@ -183,7 +183,7 @@ public void drawValues(Canvas c) {
183
183
continue ;
184
184
}
185
185
186
- boolean isInverted = mChart .isInverted (dataSet .getAxisDependency ());
186
+ boolean isInverted = chart .isInverted (dataSet .getAxisDependency ());
187
187
188
188
// apply the text-styling defined by the DataSet
189
189
applyValueTextStyle (dataSet );
@@ -192,7 +192,7 @@ public void drawValues(Canvas c) {
192
192
IValueFormatter formatter = dataSet .getValueFormatter ();
193
193
194
194
// get the buffer
195
- BarBuffer buffer = mBarBuffers [i ];
195
+ BarBuffer buffer = barBuffers [i ];
196
196
197
197
final float phaseY = mAnimator .getPhaseY ();
198
198
@@ -265,7 +265,7 @@ public void drawValues(Canvas c) {
265
265
// if each value of a potential stack should be drawn
266
266
} else {
267
267
268
- Transformer trans = mChart .getTransformer (dataSet .getAxisDependency ());
268
+ Transformer trans = chart .getTransformer (dataSet .getAxisDependency ());
269
269
270
270
int bufferIndex = 0 ;
271
271
int index = 0 ;
@@ -441,9 +441,9 @@ protected void prepareBarHighlight(float x, float y1, float y2, float barWidthHa
441
441
float left = y1 ;
442
442
float right = y2 ;
443
443
444
- mBarRect .set (left , top , right , bottom );
444
+ barRect .set (left , top , right , bottom );
445
445
446
- trans .rectToPixelPhaseHorizontal (mBarRect , mAnimator .getPhaseY ());
446
+ trans .rectToPixelPhaseHorizontal (barRect , mAnimator .getPhaseY ());
447
447
}
448
448
449
449
@ Override
0 commit comments