Skip to content

Commit 858600d

Browse files
committed
Cleanup renderers
1 parent 82ca5e7 commit 858600d

9 files changed

Lines changed: 16 additions & 121 deletions

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarLineScatterCandleBubbleRenderer.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public BarLineScatterCandleBubbleRenderer(ChartAnimator animator, ViewPortHandle
2424
* @param dataSet
2525
* @return
2626
*/
27-
protected XBounds getXBounds(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet
28-
dataSet) {
27+
protected XBounds getXBounds(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet) {
2928
return new XBounds(chart, dataSet);
3029
}
3130

@@ -34,15 +33,27 @@ protected XBounds getXBounds(BarLineScatterCandleBubbleDataProvider chart, IBarL
3433
*/
3534
protected class XBounds {
3635

37-
/** minimum visible entry index */
36+
/**
37+
* minimum visible entry index
38+
*/
3839
public final int min;
3940

40-
/** maximum visible entry index */
41+
/**
42+
* maximum visible entry index
43+
*/
4144
public final int max;
4245

43-
/** range of visible entry indices */
46+
/**
47+
* range of visible entry indices
48+
*/
4449
public final int range;
4550

51+
/**
52+
* Calculates the minimum and maximum x values as well as the range between them.
53+
*
54+
* @param chart
55+
* @param dataSet
56+
*/
4657
public XBounds(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet) {
4758

4859
float phaseX = Math.max(0.f, Math.min(1.f, mAnimator.getPhaseX()));

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/CombinedChartRenderer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import com.github.mikephil.charting.data.ChartData;
1010
import com.github.mikephil.charting.data.CombinedData;
1111
import com.github.mikephil.charting.highlight.Highlight;
12-
import com.github.mikephil.charting.interfaces.dataprovider.BarLineScatterCandleBubbleDataProvider;
13-
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
1412
import com.github.mikephil.charting.utils.ViewPortHandler;
1513

1614
import java.lang.ref.WeakReference;

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/DataRenderer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import android.graphics.Paint.Style;
99

1010
import com.github.mikephil.charting.animation.ChartAnimator;
11-
import com.github.mikephil.charting.charts.Chart;
1211
import com.github.mikephil.charting.data.Entry;
1312
import com.github.mikephil.charting.formatter.ValueFormatter;
1413
import com.github.mikephil.charting.highlight.Highlight;

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LegendRenderer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package com.github.mikephil.charting.renderer;
33

44
import android.graphics.Canvas;
5-
import android.graphics.Color;
65
import android.graphics.Paint;
76
import android.graphics.Paint.Align;
87
import android.graphics.Typeface;

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/RadarChartRenderer.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@ protected void drawDataSet(Canvas c, IRadarDataSet dataSet, int mostEntries) {
139139
// draw the line (only if filled is disabled or alpha is below 255)
140140
if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255)
141141
c.drawPath(surface, mRenderPaint);
142-
//
143-
// // draw filled
144-
// if (dataSet.isDrawFilledEnabled()) {
145-
// mRenderPaint.setStyle(Paint.Style.FILL);
146-
// mRenderPaint.setAlpha(dataSet.getFillAlpha());
147-
// c.drawPath(surface, mRenderPaint);
148-
// mRenderPaint.setAlpha(255);
149-
// }
150142
}
151143

152144
@Override

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/ScatterChartRenderer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import android.graphics.Canvas;
55
import android.graphics.Paint.Style;
66
import android.graphics.Path;
7-
import android.graphics.Point;
87

98
import com.github.mikephil.charting.animation.ChartAnimator;
109
import com.github.mikephil.charting.buffer.ScatterBuffer;

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/XAxisRendererHorizontalBarChart.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.github.mikephil.charting.components.LimitLine;
1212
import com.github.mikephil.charting.components.XAxis;
1313
import com.github.mikephil.charting.components.XAxis.XAxisPosition;
14-
import com.github.mikephil.charting.data.BarData;
1514
import com.github.mikephil.charting.utils.FSize;
1615
import com.github.mikephil.charting.utils.PointD;
1716
import com.github.mikephil.charting.utils.Transformer;

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/YAxisRenderer.java

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -40,107 +40,6 @@ public YAxisRenderer(ViewPortHandler viewPortHandler, YAxis yAxis, Transformer t
4040
}
4141
}
4242

43-
// @Override
44-
// protected void computeAxisValues(float min, float max) {
45-
//
46-
// float yMin = min;
47-
// float yMax = max;
48-
//
49-
// int labelCount = mYAxis.getLabelCount();
50-
// double range = Math.abs(yMax - yMin);
51-
//
52-
// if (labelCount == 0 || range <= 0) {
53-
// mYAxis.mEntries = new float[]{};
54-
// mYAxis.mEntryCount = 0;
55-
// return;
56-
// }
57-
//
58-
// // Find out how much spacing (in y value space) between axis values
59-
// double rawInterval = range / labelCount;
60-
// double interval = Utils.roundToNextSignificant(rawInterval);
61-
//
62-
// // If granularity is enabled, then do not allow the interval to go below specified granularity.
63-
// // This is used to avoid repeated values when rounding values for display.
64-
// if (mYAxis.isGranularityEnabled())
65-
// interval = interval < mYAxis.getGranularity() ? mYAxis.getGranularity() : interval;
66-
//
67-
// // Normalize interval
68-
// double intervalMagnitude = Utils.roundToNextSignificant(Math.pow(10, (int) Math.log10(interval)));
69-
// int intervalSigDigit = (int) (interval / intervalMagnitude);
70-
// if (intervalSigDigit > 5) {
71-
// // Use one order of magnitude higher, to avoid intervals like 0.9 or
72-
// // 90
73-
// interval = Math.floor(10 * intervalMagnitude);
74-
// }
75-
//
76-
// // force label count
77-
// if (mYAxis.isForceLabelsEnabled()) {
78-
//
79-
// float step = (float) range / (float) (labelCount - 1);
80-
// mYAxis.mEntryCount = labelCount;
81-
//
82-
// if (mYAxis.mEntries.length < labelCount) {
83-
// // Ensure stops contains at least numStops elements.
84-
// mYAxis.mEntries = new float[labelCount];
85-
// }
86-
//
87-
// float v = min;
88-
//
89-
// for (int i = 0; i < labelCount; i++) {
90-
// mYAxis.mEntries[i] = v;
91-
// v += step;
92-
// }
93-
//
94-
// // no forced count
95-
// } else {
96-
//
97-
// // if the labels should only show min and max
98-
// if (mYAxis.isShowOnlyMinMaxEnabled()) {
99-
//
100-
// mYAxis.mEntryCount = 2;
101-
// mYAxis.mEntries = new float[2];
102-
// mYAxis.mEntries[0] = yMin;
103-
// mYAxis.mEntries[1] = yMax;
104-
//
105-
// } else {
106-
//
107-
// double first = interval == 0.0 ? 0.0 : Math.ceil(yMin / interval) * interval;
108-
// double last = interval == 0.0 ? 0.0 : Utils.nextUp(Math.floor(yMax / interval) * interval);
109-
//
110-
// double f;
111-
// int i;
112-
// int n = 0;
113-
// if (interval != 0.0) {
114-
// for (f = first; f <= last; f += interval) {
115-
// ++n;
116-
// }
117-
// }
118-
//
119-
// mYAxis.mEntryCount = n;
120-
//
121-
// if (mYAxis.mEntries.length < n) {
122-
// // Ensure stops contains at least numStops elements.
123-
// mYAxis.mEntries = new float[n];
124-
// }
125-
//
126-
// for (f = first, i = 0; i < n; f += interval, ++i) {
127-
//
128-
// if (f == 0.0) // Fix for negative zero case (Where value == -0.0, and 0.0 == -0.0)
129-
// f = 0.0;
130-
//
131-
// mYAxis.mEntries[i] = (float) f;
132-
// }
133-
// }
134-
// }
135-
//
136-
// // set decimals
137-
// if (interval < 1) {
138-
// mYAxis.mDecimals = (int) Math.ceil(-Math.log10(interval));
139-
// } else {
140-
// mYAxis.mDecimals = 0;
141-
// }
142-
// }
143-
14443
/**
14544
* draws the y-axis labels to the screen
14645
*/

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/YAxisRendererHorizontalBarChart.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import android.graphics.Path;
88

99
import com.github.mikephil.charting.components.LimitLine;
10-
import com.github.mikephil.charting.components.LimitLine.LimitLabelPosition;
1110
import com.github.mikephil.charting.components.YAxis;
1211
import com.github.mikephil.charting.components.YAxis.AxisDependency;
1312
import com.github.mikephil.charting.components.YAxis.YAxisLabelPosition;

0 commit comments

Comments
 (0)