GeezerVison is showing github.com — Merge #1947 · FlyingAndroid/MPAndroidChart@43fa1e6
File treeExpand file treeCollapse file tree Open diff view settings MPChartExample/src/com/xxmassdeveloper/mpchartexample MPChartLib/src/main/java/com/github/mikephil/charting
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: MPChartExample/src/com/xxmassdeveloper/mpchartexample/LineChartActivity2.java +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -58,6 +58,7 @@ protected void onCreate(Bundle savedInstanceState) { | 58 | 58 |
| 59 | 59 | mChart = (LineChart) findViewById(R.id.chart1); | 60 | 60 | mChart.setOnChartValueSelectedListener(this); | | 61 | + mChart.setLogEnabled(true); | 61 | 62 |
| 62 | 63 | // no description text | 63 | 64 | mChart.setDescription(""); | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.java -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -105,7 +105,6 @@ public Highlight getHighlightByTouchPoint(float x, float y) { | 105 | 105 | */ | 106 | 106 | public RectF getBarBounds(BarEntry e) { | 107 | 107 |
| 108 | | - | 109 | 108 | RectF bounds = new RectF(); | 110 | 109 | getBarBounds(e, bounds); | 111 | 110 |
| @@ -143,7 +142,6 @@ public void getBarBounds(BarEntry e, RectF outputRect){ | 143 | 142 | bounds.set(left, top, right, bottom); | 144 | 143 |
| 145 | 144 | getTransformer(set.getAxisDependency()).rectValueToPixel(outputRect); | 146 | | - | 147 | 145 | } | 148 | 146 |
| 149 | 147 | /** | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1280,7 +1280,9 @@ public IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float | 1280 | 1280 | return null; | 1281 | 1281 | } | 1282 | 1282 |
| | 1283 | + /** buffer for storing lowest visible x point */ | 1283 | 1284 | protected PointD posForGetLowestVisibleX = PointD.getInstance(0,0); | | 1285 | + | 1284 | 1286 | /** | 1285 | 1287 | * Returns the lowest x-index (value on the x-axis) that is still visible on | 1286 | 1288 | * the chart. | @@ -1295,7 +1297,9 @@ public float getLowestVisibleX() { | 1295 | 1297 | return result; | 1296 | 1298 | } | 1297 | 1299 |
| | 1300 | + /** buffer for storing highest visible x point */ | 1298 | 1301 | protected PointD posForGetHighestVisibleX = PointD.getInstance(0,0); | | 1302 | + | 1299 | 1303 | /** | 1300 | 1304 | * Returns the highest x-index (value on the x-axis) that is still visible | 1301 | 1305 | * on the chart. | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/charts/Chart.java -45Lines changed: 0 additions & 45 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | import android.graphics.Color; | 13 | 13 | import android.graphics.Paint; | 14 | 14 | import android.graphics.Paint.Align; | 15 | | -import android.graphics.PointF; | 16 | 15 | import android.graphics.RectF; | 17 | 16 | import android.graphics.Typeface; | 18 | 17 | import android.graphics.drawable.Drawable; | @@ -1429,50 +1428,6 @@ public void setDrawMarkerViews(boolean enabled) { | 1429 | 1428 | mDrawMarkerViews = enabled; | 1430 | 1429 | } | 1431 | 1430 |
| 1432 | | - /** | 1433 | | - * Get all Entry objects at the given index across all DataSets. | 1434 | | - * INFORMATION: This method does calculations at runtime. Do not over-use in | 1435 | | - * performance critical situations. | 1436 | | - * | 1437 | | - * @param xIndex | 1438 | | - * @return | 1439 | | - */ | 1440 | | - public List<Entry> getEntriesAtIndex(int xIndex) { | 1441 | | - | 1442 | | - List<Entry> vals = new ArrayList<Entry>(); | 1443 | | - | 1444 | | - for (int i = 0; i < mData.getDataSetCount(); i++) { | 1445 | | - | 1446 | | - IDataSet set = mData.getDataSetByIndex(i); | 1447 | | - | 1448 | | - Entry e = set.getEntryForXPos(xIndex); | 1449 | | - | 1450 | | - if (e != null) { | 1451 | | - vals.add(e); | 1452 | | - } | 1453 | | - } | 1454 | | - | 1455 | | - return vals; | 1456 | | - } | 1457 | | - | 1458 | | - public void getEntriesAtIndex(int xIndex, List<Entry> entriesOutput){ | 1459 | | - | 1460 | | - List<Entry> vals = entriesOutput; | 1461 | | - vals.clear(); | 1462 | | - | 1463 | | - for (int i = 0; i < mData.getDataSetCount(); i++) { | 1464 | | - | 1465 | | - IDataSet set = mData.getDataSetByIndex(i); | 1466 | | - | 1467 | | - Entry e = set.getEntryForXPos(xIndex); | 1468 | | - | 1469 | | - if (e != null) { | 1470 | | - vals.add(e); | 1471 | | - } | 1472 | | - } | 1473 | | - | 1474 | | - } | 1475 | | - | 1476 | 1431 | /** | 1477 | 1432 | * Returns the ChartData object that has been set for the chart. | 1478 | 1433 | * | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/charts/HorizontalBarChart.java -4Lines changed: 0 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | package com.github.mikephil.charting.charts; | 2 | 2 |
| 3 | 3 | import android.content.Context; | 4 | | -import android.graphics.PointF; | 5 | 4 | import android.graphics.RectF; | 6 | 5 | import android.util.AttributeSet; | 7 | 6 | import android.util.Log; | | 18 | 17 | import com.github.mikephil.charting.renderer.YAxisRendererHorizontalBarChart; | 19 | 18 | import com.github.mikephil.charting.utils.HorizontalViewPortHandler; | 20 | 19 | import com.github.mikephil.charting.utils.MPPointF; | 21 | | -import com.github.mikephil.charting.utils.PointD; | 22 | 20 | import com.github.mikephil.charting.utils.TransformerHorizontalBarChart; | 23 | 21 | import com.github.mikephil.charting.utils.Utils; | 24 | 22 |
| @@ -209,7 +207,6 @@ public Highlight getHighlightByTouchPoint(float x, float y) { | 209 | 207 | return getHighlighter().getHighlight(y, x); // switch x and y | 210 | 208 | } | 211 | 209 |
| 212 | | - protected PointD posForGetLowestVisibleX = PointD.getInstance(0,0); | 213 | 210 | @Override | 214 | 211 | public float getLowestVisibleX() { | 215 | 212 | getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(), | @@ -218,7 +215,6 @@ public float getLowestVisibleX() { | 218 | 215 | return result; | 219 | 216 | } | 220 | 217 |
| 221 | | - protected PointD posForGetHighestVisibleX = PointD.getInstance(0,0); | 222 | 218 | @Override | 223 | 219 | public float getHighestVisibleX() { | 224 | 220 | getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(), | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/data/BarDataSet.java +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,11 +51,10 @@ public BarDataSet(List<BarEntry> yVals, String label) { | 51 | 51 | calcEntryCountIncludingStacks(yVals); | 52 | 52 | } | 53 | 53 |
| 54 | | - protected List<BarEntry> barEntriesForCopy = new ArrayList<>(); | 55 | 54 | @Override | 56 | 55 | public DataSet<BarEntry> copy() { | 57 | 56 |
| 58 | | - List<BarEntry> yVals = barEntriesForCopy; | | 57 | + List<BarEntry> yVals = new ArrayList<BarEntry>(); | 59 | 58 | yVals.clear(); | 60 | 59 |
| 61 | 60 | for (int i = 0; i < mValues.size(); i++) { | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/data/BaseDataSet.java +3-5Lines changed: 3 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -169,14 +169,12 @@ public void setColors(int[] colors, Context c) { | 169 | 169 | if(mColors == null){ | 170 | 170 | mColors = new ArrayList<>(); | 171 | 171 | } | 172 | | - List<Integer> clrs = mColors; | 173 | | - clrs.clear(); | | 172 | + | | 173 | + mColors.clear(); | 174 | 174 |
| 175 | 175 | for (int color : colors) { | 176 | | - clrs.add(c.getResources().getColor(color)); | | 176 | + mColors.add(c.getResources().getColor(color)); | 177 | 177 | } | 178 | | - | 179 | | - mColors = clrs; | 180 | 178 | } | 181 | 179 |
| 182 | 180 | /** | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/data/BubbleData.java +2-6Lines changed: 2 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 |
| 4 | 4 | import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; | 5 | 5 |
| 6 | | -import java.util.ArrayList; | 7 | 6 | import java.util.List; | 8 | 7 |
| 9 | 8 | public class BubbleData extends BarLineScatterCandleBubbleData<IBubbleDataSet> { | @@ -28,11 +27,8 @@ public BubbleData(List<IBubbleDataSet> dataSets) { | 28 | 27 | * @param width | 29 | 28 | */ | 30 | 29 | public void setHighlightCircleWidth(float width) { | 31 | | - IBubbleDataSet set; | 32 | | - final int setCount = mDataSets.size(); | 33 | | - for(int i = 0 ; i < setCount ; i++){ | 34 | | - set = mDataSets.get(i); | 35 | | - set.setHighlightCircleWidth(width); | | 30 | + for(int i = 0 ; i < mDataSets.size() ; i++){ | | 31 | + mDataSets.get(i).setHighlightCircleWidth(width); | 36 | 32 | } | 37 | 33 | } | 38 | 34 | } |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/data/BubbleDataSet.java +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,12 +51,10 @@ public void calcMinMax() { | 51 | 51 | } | 52 | 52 | } | 53 | 53 |
| 54 | | - protected ArrayList<BubbleEntry> bubbleEntriesForCopy = new ArrayList<>(); | 55 | 54 | @Override | 56 | 55 | public DataSet<BubbleEntry> copy() { | 57 | 56 |
| 58 | | - List<BubbleEntry> yVals = bubbleEntriesForCopy; | 59 | | - yVals.clear(); | | 57 | + List<BubbleEntry> yVals = new ArrayList<BubbleEntry>(); | 60 | 58 |
| 61 | 59 | for (int i = 0; i < mValues.size(); i++) { | 62 | 60 | yVals.add(mValues.get(i).copy()); | |
Collapse file Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/data/CandleDataSet.java +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -77,15 +77,14 @@ public CandleDataSet(List<CandleEntry> yVals, String label) { | 77 | 77 | super(yVals, label); | 78 | 78 | } | 79 | 79 |
| 80 | | - protected ArrayList<CandleEntry> candleEntriesForCopy = new ArrayList<>(); | 81 | 80 | @Override | 82 | 81 | public DataSet<CandleEntry> copy() { | 83 | 82 |
| 84 | | - List<CandleEntry> yVals = candleEntriesForCopy; | | 83 | + List<CandleEntry> yVals = new ArrayList<CandleEntry>(); | 85 | 84 | yVals.clear(); | 86 | 85 |
| 87 | 86 | for (int i = 0; i < mValues.size(); i++) { | 88 | | - yVals.add(((CandleEntry) mValues.get(i)).copy()); | | 87 | + yVals.add(mValues.get(i).copy()); | 89 | 88 | } | 90 | 89 |
| 91 | 90 | CandleDataSet copied = new CandleDataSet(yVals, getLabel()); | |
|