Skip to content

Commit 16738ef

Browse files
committed
Import cleanup
1 parent e2cbafa commit 16738ef

11 files changed

Lines changed: 30 additions & 85 deletions

File tree

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public RectF getBarBounds(BarEntry e) {
118118
* @param e
119119
* @return
120120
*/
121-
public void getBarBounds(BarEntry e, RectF outputRect){
121+
public void getBarBounds(BarEntry e, RectF outputRect) {
122122

123123
RectF bounds = outputRect;
124124

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java‎

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -511,25 +511,6 @@ public void calculateOffsets() {
511511
prepareValuePxMatrix();
512512
}
513513

514-
// @Override
515-
// protected float[] getMarkerPosition(Highlight high) {
516-
// return new float[] { high.getXPx(), high.getYPx() };
517-
//
518-
// int dataSetIndex = highlight.getDataSetIndex();
519-
// float xPos = e.getX();
520-
// float yPos = e.getY() * mAnimator.getPhaseY();
521-
//
522-
// // position of the marker depends on selected value index and value
523-
// float[] pts = new float[]{
524-
// xPos, yPos
525-
// };
526-
//
527-
// getTransformer(mData.getDataSetByIndex(dataSetIndex).getAxisDependency())
528-
// .pointValuesToPixel(pts);
529-
//
530-
// return pts;
531-
// }
532-
533514
/**
534515
* draws the grid background
535516
*/
@@ -1044,13 +1025,12 @@ public MPPointF getPosition(Entry e, AxisDependency axis) {
10441025
if (e == null)
10451026
return null;
10461027

1047-
float[] vals = mGetPositionBuffer;
1048-
vals[0] = e.getX();
1049-
vals[1] = e.getY();
1028+
mGetPositionBuffer[0] = e.getX();
1029+
mGetPositionBuffer[1] = e.getY();
10501030

1051-
getTransformer(axis).pointValuesToPixel(vals);
1031+
getTransformer(axis).pointValuesToPixel(mGetPositionBuffer);
10521032

1053-
return MPPointF.getInstance(vals[0], vals[1]);
1033+
return MPPointF.getInstance(mGetPositionBuffer[0], mGetPositionBuffer[1]);
10541034
}
10551035

10561036
/**
@@ -1255,22 +1235,6 @@ public MPPointD getPixelsForValues(float x, float y, AxisDependency axis) {
12551235
return getTransformer(axis).getPixelsForValues(x, y);
12561236
}
12571237

1258-
MPPointD pointForGetYValueByTouchPoint = MPPointD.getInstance(0, 0);
1259-
1260-
/**
1261-
* Returns y value at the given touch position (must not necessarily be
1262-
* a value contained in one of the datasets)
1263-
*
1264-
* @param x
1265-
* @param y
1266-
* @return
1267-
*/
1268-
public float getYValueByTouchPoint(float x, float y, AxisDependency axis) {
1269-
getValuesByTouchPoint(x, y, axis, pointForGetYValueByTouchPoint);
1270-
float result = (float) pointForGetYValueByTouchPoint.y;
1271-
return result;
1272-
}
1273-
12741238
/**
12751239
* returns the Entry object displayed at the touched position of the chart
12761240
*

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/BubbleChart.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import com.github.mikephil.charting.data.BubbleData;
88
import com.github.mikephil.charting.interfaces.dataprovider.BubbleDataProvider;
9-
import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet;
109
import com.github.mikephil.charting.renderer.BubbleChartRenderer;
1110

1211
/**

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/CandleStickChart.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* Financial chart type that draws candle-sticks (OHCL chart).
13-
*
13+
*
1414
* @author Philipp Jahoda
1515
*/
1616
public class CandleStickChart extends BarLineChartBase<CandleData> implements CandleDataProvider {
@@ -32,7 +32,6 @@ protected void init() {
3232
super.init();
3333

3434
mRenderer = new CandleStickChartRenderer(this, mAnimator, mViewPortHandler);
35-
mXAxis.mAxisMinimum = -0.5f;
3635
}
3736

3837
@Override

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/Chart.java‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ public void setData(T data) {
308308
IDataSet set;
309309
final List sets = mData.getDataSets();
310310
final int count = sets.size();
311-
for(int i = 0 ; i < count ; i++){
312-
set = (IDataSet)sets.get(i);
311+
for (int i = 0; i < count; i++) {
312+
set = (IDataSet) sets.get(i);
313313
if (set.needsFormatter() || set.getValueFormatter() == mDefaultFormatter)
314314
set.setValueFormatter(mDefaultFormatter);
315315
}
@@ -486,7 +486,7 @@ protected void drawDescription(Canvas c) {
486486
protected Highlight[] mIndicesToHighlight;
487487

488488
/**
489-
* The maximum distance in screen pixels away from an entry causing it to highlight.
489+
* The maximum distance in dp away from an entry causing it to highlight.
490490
*/
491491
protected float mMaxHighlightDistance = 0f;
492492

@@ -1100,9 +1100,9 @@ public void setDescription(String desc) {
11001100
* @param y - ycoordinate
11011101
*/
11021102
public void setDescriptionPosition(float x, float y) {
1103-
if(mDescriptionPosition == null){
1104-
mDescriptionPosition = MPPointF.getInstance(x,y);
1105-
}else {
1103+
if (mDescriptionPosition == null) {
1104+
mDescriptionPosition = MPPointF.getInstance(x, y);
1105+
} else {
11061106
mDescriptionPosition.x = x;
11071107
mDescriptionPosition.y = y;
11081108
}
@@ -1478,12 +1478,12 @@ public Highlighter getHighlighter() {
14781478
* @param highlighter
14791479
*/
14801480
public void setHighlighter(ChartHighlighter highlighter) {
1481-
14821481
mHighlighter = highlighter;
14831482
}
14841483

14851484
/**
14861485
* Returns a recyclable MPPointF instance.
1486+
*
14871487
* @return
14881488
*/
14891489
@Override

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/HorizontalBarChart.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void getBarBounds(BarEntry e, RectF outputRect) {
144144
RectF bounds = outputRect;
145145
IBarDataSet set = mData.getDataSetForEntry(e);
146146

147-
if (set == null){
147+
if (set == null) {
148148
outputRect.set(Float.MIN_VALUE, Float.MIN_VALUE, Float.MIN_VALUE, Float.MIN_VALUE);
149149
return;
150150
}
@@ -166,6 +166,7 @@ public void getBarBounds(BarEntry e, RectF outputRect) {
166166
}
167167

168168
protected float[] mGetPositionBuffer = new float[2];
169+
169170
/**
170171
* Returns a recyclable MPPointF instance.
171172
*

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/LineChart.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* Chart that draws lines, surfaces, circles, ...
13-
*
13+
*
1414
* @author Philipp Jahoda
1515
*/
1616
public class LineChart extends BarLineChartBase<LineData> implements LineDataProvider {
@@ -33,7 +33,7 @@ protected void init() {
3333

3434
mRenderer = new LineChartRenderer(this, mAnimator, mViewPortHandler);
3535
}
36-
36+
3737
@Override
3838
public LineData getLineData() {
3939
return mData;
@@ -42,7 +42,7 @@ public LineData getLineData() {
4242
@Override
4343
protected void onDetachedFromWindow() {
4444
// releases the bitmap in the renderer to avoid oom error
45-
if(mRenderer != null && mRenderer instanceof LineChartRenderer) {
45+
if (mRenderer != null && mRenderer instanceof LineChartRenderer) {
4646
((LineChartRenderer) mRenderer).releaseBitmap();
4747
}
4848
super.onDetachedFromWindow();

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieChart.java‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import android.content.Context;
55
import android.graphics.Canvas;
66
import android.graphics.Paint;
7-
import android.graphics.PointF;
87
import android.graphics.RectF;
98
import android.graphics.Typeface;
109
import android.util.AttributeSet;
@@ -210,17 +209,17 @@ private void calcAngles() {
210209

211210
int entryCount = mData.getEntryCount();
212211

213-
if(mDrawAngles.length != entryCount) {
212+
if (mDrawAngles.length != entryCount) {
214213
mDrawAngles = new float[entryCount];
215-
}else{
216-
for(int i = 0 ; i < entryCount ; i++){
214+
} else {
215+
for (int i = 0; i < entryCount; i++) {
217216
mDrawAngles[i] = 0;
218217
}
219218
}
220-
if(mAbsoluteAngles.length != entryCount) {
219+
if (mAbsoluteAngles.length != entryCount) {
221220
mAbsoluteAngles = new float[entryCount];
222-
}else{
223-
for(int i = 0 ; i < entryCount ; i++){
221+
} else {
222+
for (int i = 0; i < entryCount; i++) {
224223
mAbsoluteAngles[i] = 0;
225224
}
226225
}

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieRadarChartBase.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import android.animation.ValueAnimator.AnimatorUpdateListener;
77
import android.annotation.SuppressLint;
88
import android.content.Context;
9-
import android.graphics.PointF;
109
import android.graphics.RectF;
1110
import android.util.AttributeSet;
1211
import android.util.Log;
@@ -17,7 +16,6 @@
1716
import com.github.mikephil.charting.components.XAxis;
1817
import com.github.mikephil.charting.data.ChartData;
1918
import com.github.mikephil.charting.data.Entry;
20-
import com.github.mikephil.charting.highlight.Highlight;
2119
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
2220
import com.github.mikephil.charting.listener.PieRadarChartTouchListener;
2321
import com.github.mikephil.charting.utils.MPPointF;
@@ -297,12 +295,12 @@ public float getAngleForPoint(float x, float y) {
297295
*/
298296
public MPPointF getPosition(MPPointF center, float dist, float angle) {
299297

300-
MPPointF p = MPPointF.getInstance(0,0);
298+
MPPointF p = MPPointF.getInstance(0, 0);
301299
getPosition(center, dist, angle, p);
302300
return p;
303301
}
304302

305-
public void getPosition(MPPointF center, float dist, float angle, MPPointF outputPoint){
303+
public void getPosition(MPPointF center, float dist, float angle, MPPointF outputPoint) {
306304
outputPoint.x = (float) (center.x + dist * Math.cos(Math.toRadians(angle)));
307305
outputPoint.y = (float) (center.y + dist * Math.sin(Math.toRadians(angle)));
308306
}

‎MPChartLib/src/main/java/com/github/mikephil/charting/charts/RadarChart.java‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44
import android.content.Context;
55
import android.graphics.Canvas;
66
import android.graphics.Color;
7-
import android.graphics.PointF;
87
import android.graphics.RectF;
98
import android.util.AttributeSet;
109

1110
import com.github.mikephil.charting.components.YAxis;
1211
import com.github.mikephil.charting.components.YAxis.AxisDependency;
13-
import com.github.mikephil.charting.data.Entry;
1412
import com.github.mikephil.charting.data.RadarData;
15-
import com.github.mikephil.charting.highlight.Highlight;
1613
import com.github.mikephil.charting.highlight.RadarHighlighter;
1714
import com.github.mikephil.charting.renderer.RadarChartRenderer;
1815
import com.github.mikephil.charting.renderer.XAxisRendererRadarChart;
@@ -106,22 +103,6 @@ protected void calcMinMax() {
106103
mXAxis.calculate(0, mData.getMaxEntryCountSet().getEntryCount());
107104
}
108105

109-
// @Override
110-
// protected float[] getMarkerPosition(Highlight highlight) {
111-
// return null;
112-
//
113-
//// float angle = getSliceAngle() * e.getX() * mAnimator.getPhaseX() + getRotationAngle();
114-
//// float val = e.getY() * getFactor() * mAnimator.getPhaseY();
115-
//// PointF c = getCenterOffsets();
116-
////
117-
//// PointF p = new PointF((float) (c.x + val * Math.cos(Math.toRadians(angle))),
118-
//// (float) (c.y + val * Math.sin(Math.toRadians(angle))));
119-
////
120-
//// return new float[]{
121-
//// p.x, p.y
122-
//// };
123-
// }
124-
125106
@Override
126107
public void notifyDataSetChanged() {
127108
if (mData == null)

0 commit comments

Comments
 (0)