diff options
author | Daniel Cohen Gindi <danielgindi@gmail.com> | 2016-08-08 10:14:58 +0300 |
---|---|---|
committer | Daniel Cohen Gindi <danielgindi@gmail.com> | 2016-08-08 10:14:58 +0300 |
commit | f63002e196fb2c86393c018061163c84b2d110a9 (patch) | |
tree | 03363935689bf2a68efb11f1c4d17eca1c18aa83 /MPChartLib | |
parent | 77c10fc9e56f9d9538773af9e5af06c072f2318c (diff) | |
download | MPAndroidChart-f63002e196fb2c86393c018061163c84b2d110a9.tar.gz |
Renamed x-pos to x-value where appropriate
Diffstat (limited to 'MPChartLib')
20 files changed, 76 insertions, 78 deletions
diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.java b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.java index 6f3692c2..a149adf9 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.java @@ -202,7 +202,7 @@ public class BarChart extends BarLineChartBase<BarData> implements BarDataProvid } /** - * Highlights the value at the given x-position in the given DataSet. Provide + * Highlights the value at the given x-value in the given DataSet. Provide * -1 as the dataSetIndex to undo all highlighting. * * @param x @@ -230,8 +230,8 @@ public class BarChart extends BarLineChartBase<BarData> implements BarDataProvid } /** - * Groups all BarDataSet objects this data object holds together by modifying the x-position of their entries. - * Previously set x-positions of entries will be overwritten. Leaves space between bars and groups as specified + * Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries. + * Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified * by the parameters. * Calls notifyDataSetChanged() afterwards. * diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/Chart.java b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/Chart.java index ec4d3840..74823825 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/Chart.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/Chart.java @@ -581,7 +581,7 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent } /** - * Highlights the value at the given x-position in the given DataSet. Provide + * Highlights the value at the given x-value in the given DataSet. Provide * -1 as the dataSetIndex to undo all highlighting. This will trigger a callback to the OnChartValueSelectedListener. * * @param x @@ -592,7 +592,7 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent } /** - * Highlights the value at the given x position in the given DataSet. Provide + * Highlights the value at the given x-value in the given DataSet. Provide * -1 as the dataSetIndex to undo all highlighting. * * @param x diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieChart.java b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieChart.java index bad10dbb..d2acf19b 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieChart.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieChart.java @@ -328,7 +328,7 @@ public class PieChart extends PieRadarChartBase<PieData> { List<IPieDataSet> dataSets = mData.getDataSets(); for (int i = 0; i < dataSets.size(); i++) { - if (dataSets.get(i).getEntryForXPos(xIndex) != null) + if (dataSets.get(i).getEntryForXValue(xIndex) != null) return i; } diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarData.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarData.java index 609d480d..601364db 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarData.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/BarData.java @@ -44,8 +44,8 @@ public class BarData extends BarLineScatterCandleBubbleData<IBarDataSet> { } /** - * Groups all BarDataSet objects this data object holds together by modifying the x-position of their entries. - * Previously set x-positions of entries will be overwritten. Leaves space between bars and groups as specified + * Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries. + * Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified * by the parameters. * Do not forget to call notifyDataSetChanged() on your BarChart object after calling this method. * diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/BaseDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/BaseDataSet.java index 28dd77ce..55d7309c 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/BaseDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/BaseDataSet.java @@ -387,9 +387,9 @@ public abstract class BaseDataSet<T extends Entry> implements IDataSet<T> { } @Override - public boolean removeEntryByXPos(float xPos) { + public boolean removeEntryByXValue(float xValue) { - T e = getEntryForXPos(xPos); + T e = getEntryForXValue(xValue); return removeEntry(e); } diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java index a8496b3b..0d8c52bd 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/ChartData.java @@ -335,7 +335,7 @@ public abstract class ChartData<T extends IDataSet<? extends Entry>> { if (highlight.getDataSetIndex() >= mDataSets.size()) return null; else { - return mDataSets.get(highlight.getDataSetIndex()).getEntryForXPos(highlight.getX()); + return mDataSets.get(highlight.getDataSetIndex()).getEntryForXValue(highlight.getX()); } } @@ -526,17 +526,17 @@ public abstract class ChartData<T extends IDataSet<? extends Entry>> { * specified index. Returns true if an Entry was removed, false if no Entry * was found that meets the specified requirements. * - * @param xPos + * @param xValue * @param dataSetIndex * @return */ - public boolean removeEntry(float xPos, int dataSetIndex) { + public boolean removeEntry(float xValue, int dataSetIndex) { if (dataSetIndex >= mDataSets.size()) return false; IDataSet dataSet = mDataSets.get(dataSetIndex); - Entry e = dataSet.getEntryForXPos(xPos); + Entry e = dataSet.getEntryForXValue(xValue); if (e == null) return false; @@ -561,7 +561,7 @@ public abstract class ChartData<T extends IDataSet<? extends Entry>> { T set = mDataSets.get(i); for (int j = 0; j < set.getEntryCount(); j++) { - if (e.equalTo(set.getEntryForXPos(e.getX()))) + if (e.equalTo(set.getEntryForXValue(e.getX()))) return set; } } diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java index 0b6b9443..035ad9e0 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/CombinedData.java @@ -3,10 +3,8 @@ package com.github.mikephil.charting.data; import android.util.Log; -import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.highlight.Highlight; import com.github.mikephil.charting.interfaces.datasets.IBarLineScatterCandleBubbleDataSet; -import com.github.mikephil.charting.interfaces.datasets.IDataSet; import java.util.ArrayList; import java.util.List; @@ -194,7 +192,7 @@ public class CombinedData extends BarLineScatterCandleBubbleData<IBarLineScatter // if we are not interested in highlighting a specific value. List<Entry> entries = data.getDataSetByIndex(highlight.getDataSetIndex()) - .getEntriesForXPos(highlight.getX()); + .getEntriesForXValue(highlight.getX()); for (Entry entry : entries) if (entry.getY() == highlight.getY() || Float.isNaN(highlight.getY())) @@ -243,7 +241,7 @@ public class CombinedData extends BarLineScatterCandleBubbleData<IBarLineScatter @Deprecated @Override - public boolean removeEntry(float xPos, int dataSetIndex) { + public boolean removeEntry(float xValue, int dataSetIndex) { Log.e("MPAndroidChart", "removeEntry(...) not supported for CombinedData"); return false; } diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/data/DataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/data/DataSet.java index 42571e95..d337a048 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/data/DataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/data/DataSet.java @@ -239,17 +239,17 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { } @Override - public T getEntryForXPos(float xPos, Rounding rounding) { + public T getEntryForXValue(float xValue, Rounding rounding) { - int index = getEntryIndex(xPos, rounding); + int index = getEntryIndex(xValue, rounding); if (index > -1) return mValues.get(index); return null; } @Override - public T getEntryForXPos(float xPos) { - return getEntryForXPos(xPos, Rounding.CLOSEST); + public T getEntryForXValue(float xValue) { + return getEntryForXValue(xValue, Rounding.CLOSEST); } @Override @@ -258,7 +258,7 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { } @Override - public int getEntryIndex(float xPos, Rounding rounding) { + public int getEntryIndex(float xValue, Rounding rounding) { if (mValues == null || mValues.isEmpty()) return -1; @@ -269,8 +269,8 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { while (low < high) { int m = (low + high) / 2; - float d1 = Math.abs(mValues.get(m).getX() - xPos); - float d2 = Math.abs(mValues.get(m + 1).getX() - xPos); + float d1 = Math.abs(mValues.get(m).getX() - xValue); + float d2 = Math.abs(mValues.get(m + 1).getX() - xValue); if (d2 <= d1) { low = m + 1; @@ -280,13 +280,13 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { } if (high != -1) { - float closestXPos = mValues.get(high).getX(); + float closestXValue = mValues.get(high).getX(); if (rounding == Rounding.UP) { - if (closestXPos < xPos && high < mValues.size() - 1) { + if (closestXValue < xValue && high < mValues.size() - 1) { ++high; } } else if (rounding == Rounding.DOWN) { - if (closestXPos > xPos && high > 0) { + if (closestXValue > xValue && high > 0) { --high; } } @@ -300,11 +300,11 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { * does calculations at runtime. Do not over-use in performance critical * situations. * - * @param xVal + * @param xValue * @return */ @Override - public List<T> getEntriesForXPos(float xVal) { + public List<T> getEntriesForXValue(float xValue) { List<T> entries = new ArrayList<T>(); @@ -315,14 +315,14 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { int m = (high + low) / 2; T entry = mValues.get(m); - if (xVal == entry.getX()) { - while (m > 0 && mValues.get(m - 1).getX() == xVal) + if (xValue == entry.getX()) { + while (m > 0 && mValues.get(m - 1).getX() == xValue) m--; high = mValues.size(); for (; m < high; m++) { entry = mValues.get(m); - if (entry.getX() == xVal) { + if (entry.getX() == xValue) { entries.add(entry); } else { break; @@ -331,7 +331,7 @@ public abstract class DataSet<T extends Entry> extends BaseDataSet<T> { break; } else { - if (xVal > entry.getX()) + if (xValue > entry.getX()) low = m + 1; else high = m - 1; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/BarHighlighter.java b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/BarHighlighter.java index 0a5fb250..b60eeabf 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/BarHighlighter.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/BarHighlighter.java @@ -54,7 +54,7 @@ public class BarHighlighter extends ChartHighlighter<BarDataProvider> { */ public Highlight getStackedHighlight(Highlight high, IBarDataSet set, float xVal, float yVal) { - BarEntry entry = set.getEntryForXPos(xVal); + BarEntry entry = set.getEntryForXValue(xVal); if (entry == null) return null; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java index 59a38f61..03491877 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/ChartHighlighter.java @@ -66,7 +66,7 @@ public class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider> */ protected Highlight getHighlightForX(float xVal, float x, float y) { - List<Highlight> closestValues = getHighlightsAtXPos(xVal, x, y); + List<Highlight> closestValues = getHighlightsAtXValue(xVal, x, y); if(closestValues.isEmpty()) { return null; @@ -124,7 +124,7 @@ public class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider> * @param y touch position * @return */ - protected List<Highlight> getHighlightsAtXPos(float xVal, float x, float y) { + protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); @@ -162,7 +162,7 @@ public class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider> */ protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) { - final Entry e = set.getEntryForXPos(xVal, rounding); + final Entry e = set.getEntryForXValue(xVal, rounding); if (e == null) return null; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/CombinedHighlighter.java b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/CombinedHighlighter.java index eaff38c2..d2275187 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/CombinedHighlighter.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/CombinedHighlighter.java @@ -28,7 +28,7 @@ public class CombinedHighlighter extends ChartHighlighter<CombinedDataProvider> } @Override - protected List<Highlight> getHighlightsAtXPos(float xVal, float x, float y) { + protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/HorizontalBarHighlighter.java b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/HorizontalBarHighlighter.java index 97cb11bf..60ec66ba 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/HorizontalBarHighlighter.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/highlight/HorizontalBarHighlighter.java @@ -45,7 +45,7 @@ public class HorizontalBarHighlighter extends BarHighlighter { @Override protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) { - final Entry e = set.getEntryForXPos(xVal, rounding); + final Entry e = set.getEntryForXValue(xVal, rounding); MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelForValues(e.getY(), e.getX()); diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IDataSet.java b/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IDataSet.java index aadd6efc..f36cee92 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IDataSet.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IDataSet.java @@ -58,40 +58,40 @@ public interface IDataSet<T extends Entry> { void calcMinMax(); /** - * Returns the first Entry object found at the given xPos with binary - * search. If the no Entry at the specified xPos is found, this method - * returns the Entry at the xPos according to the rounding. + * Returns the first Entry object found at the given x-value with binary + * search. If the no Entry at the specified x-value is found, this method + * returns the Entry at the x-value according to the rounding. * INFORMATION: This method does calculations at runtime. Do * not over-use in performance critical situations. * - * @param xPos + * @param xValue * @param rounding determine to round up/down/closest if there is no Entry matching the provided x-index * @return */ - T getEntryForXPos(float xPos, DataSet.Rounding rounding); + T getEntryForXValue(float xValue, DataSet.Rounding rounding); /** - * Returns the first Entry object found at the given xPos with binary - * search. If the no Entry at the specified xPos is found, this method - * returns the index at the closest xPos. + * Returns the first Entry object found at the given x-value with binary + * search. If the no Entry at the specified x-value is found, this method + * returns the index at the closest x-value. * INFORMATION: This method does calculations at runtime. Do * not over-use in performance critical situations. * - * @param xPos + * @param xValue * @return */ - T getEntryForXPos(float xPos); + T getEntryForXValue(float xValue); /** - * Returns all Entry objects found at the given xPos with binary - * search. An empty array if no Entry object at that xPos. + * Returns all Entry objects found at the given x-value with binary + * search. An empty array if no Entry object at that x-value. * INFORMATION: This method does calculations at runtime. Do * not over-use in performance critical situations. * - * @param xPos + * @param xValue * @return */ - List<T> getEntriesForXPos(float xPos); + List<T> getEntriesForXValue(float xValue); /** * Returns the Entry object found at the given index (NOT xIndex) in the values array. @@ -102,17 +102,17 @@ public interface IDataSet<T extends Entry> { T getEntryForIndex(int index); /** - * Returns the first Entry index found at the given xPos with binary - * search. If the no Entry at the specified xPos is found, this method - * returns the Entry at the closest xPos. + * Returns the first Entry index found at the given x-value with binary + * search. If the no Entry at the specified x-value is found, this method + * returns the Entry at the closest x-value. * INFORMATION: This method does calculations at runtime. Do * not over-use in performance critical situations. * - * @param xPos + * @param xValue * @param rounding determine to round up/down/closest if there is no Entry matching the provided x-index * @return */ - int getEntryIndex(float xPos, DataSet.Rounding rounding); + int getEntryIndex(float xValue, DataSet.Rounding rounding); /** * Returns the position of the provided entry in the DataSets Entry array. @@ -183,12 +183,12 @@ public interface IDataSet<T extends Entry> { boolean removeEntry(T e); /** - * Removes the Entry object closest to the given xPos from the DataSet. + * Removes the Entry object closest to the given x-value from the DataSet. * Returns true if an Entry was removed, false if no Entry could be removed. * - * @param xPos + * @param xValue */ - boolean removeEntryByXPos(float xPos); + boolean removeEntryByXValue(float xValue); /** * Removes the Entry object at the given index in the values array from the DataSet. diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarChartRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarChartRenderer.java index 7402f3f2..cf41858f 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarChartRenderer.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarChartRenderer.java @@ -341,7 +341,7 @@ public class BarChartRenderer extends BarLineScatterCandleBubbleRenderer { if (set == null || !set.isHighlightEnabled()) continue; - BarEntry e = set.getEntryForXPos(high.getX()); + BarEntry e = set.getEntryForXValue(high.getX()); if (!isInBoundsX(e, set)) continue; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarLineScatterCandleBubbleRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarLineScatterCandleBubbleRenderer.java index 8f2447d9..5b58a01d 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarLineScatterCandleBubbleRenderer.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BarLineScatterCandleBubbleRenderer.java @@ -85,8 +85,8 @@ public abstract class BarLineScatterCandleBubbleRenderer extends DataRenderer { float low = chart.getLowestVisibleX(); float high = chart.getHighestVisibleX(); - Entry entryFrom = dataSet.getEntryForXPos(low, DataSet.Rounding.DOWN); - Entry entryTo = dataSet.getEntryForXPos(high, DataSet.Rounding.UP); + Entry entryFrom = dataSet.getEntryForXValue(low, DataSet.Rounding.DOWN); + Entry entryTo = dataSet.getEntryForXValue(high, DataSet.Rounding.UP); min = dataSet.getEntryIndex(entryFrom); max = dataSet.getEntryIndex(entryTo); diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BubbleChartRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BubbleChartRenderer.java index e4fc5cef..2a0bfcbb 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BubbleChartRenderer.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/BubbleChartRenderer.java @@ -194,7 +194,7 @@ public class BubbleChartRenderer extends BarLineScatterCandleBubbleRenderer { continue; // In bubble charts - it makes sense to have multiple bubbles on the same X value in the same dataset. - final List<BubbleEntry> entries = set.getEntriesForXPos(high.getX()); + final List<BubbleEntry> entries = set.getEntriesForXValue(high.getX()); for (BubbleEntry entry : entries) { diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java index cdd79f41..ffc7479c 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/CandleStickChartRenderer.java @@ -317,7 +317,7 @@ public class CandleStickChartRenderer extends LineScatterCandleRadarRenderer { if (set == null || !set.isHighlightEnabled()) continue; - CandleEntry e = set.getEntryForXPos(high.getX()); + CandleEntry e = set.getEntryForXValue(high.getX()); if (!isInBoundsX(e, set)) continue; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java index 85e95a76..e29686bf 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java @@ -663,7 +663,7 @@ public class LineChartRenderer extends LineRadarRenderer { if (set == null || !set.isHighlightEnabled()) continue; - Entry e = set.getEntryForXPos(high.getX()); + Entry e = set.getEntryForXValue(high.getX()); if (!isInBoundsX(e, set)) continue; diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/ScatterChartRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/ScatterChartRenderer.java index 2341ca5b..e3da3cce 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/ScatterChartRenderer.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/ScatterChartRenderer.java @@ -143,7 +143,7 @@ public class ScatterChartRenderer extends LineScatterCandleRadarRenderer { if (set == null || !set.isHighlightEnabled()) continue; - Entry e = set.getEntryForXPos(high.getX()); + Entry e = set.getEntryForXValue(high.getX()); if (!isInBoundsX(e, set)) continue; diff --git a/MPChartLib/src/test/java/com/github/mikephil/charting/test/DataSetTest.java b/MPChartLib/src/test/java/com/github/mikephil/charting/test/DataSetTest.java index 4ade7977..381c2b23 100644 --- a/MPChartLib/src/test/java/com/github/mikephil/charting/test/DataSetTest.java +++ b/MPChartLib/src/test/java/com/github/mikephil/charting/test/DataSetTest.java @@ -141,7 +141,7 @@ public class DataSetTest { } @Test - public void testGetEntryForXPos() { + public void testGetEntryForXValue() { List<Entry> entries = new ArrayList<Entry>(); entries.add(new Entry(10, 10)); @@ -150,31 +150,31 @@ public class DataSetTest { ScatterDataSet set = new ScatterDataSet(entries, ""); - Entry closest = set.getEntryForXPos(17, DataSet.Rounding.CLOSEST); + Entry closest = set.getEntryForXValue(17, DataSet.Rounding.CLOSEST); assertEquals(15, closest.getX(), 0.01f); assertEquals(5, closest.getY(), 0.01f); - closest = set.getEntryForXPos(17, DataSet.Rounding.DOWN); + closest = set.getEntryForXValue(17, DataSet.Rounding.DOWN); assertEquals(15, closest.getX(), 0.01f); assertEquals(5, closest.getY(), 0.01f); - closest = set.getEntryForXPos(15, DataSet.Rounding.DOWN); + closest = set.getEntryForXValue(15, DataSet.Rounding.DOWN); assertEquals(15, closest.getX(), 0.01f); assertEquals(5, closest.getY(), 0.01f); - closest = set.getEntryForXPos(14, DataSet.Rounding.DOWN); + closest = set.getEntryForXValue(14, DataSet.Rounding.DOWN); assertEquals(10, closest.getX(), 0.01f); assertEquals(10, closest.getY(), 0.01f); - closest = set.getEntryForXPos(17, DataSet.Rounding.UP); + closest = set.getEntryForXValue(17, DataSet.Rounding.UP); assertEquals(21, closest.getX(), 0.01f); assertEquals(5, closest.getY(), 0.01f); - closest = set.getEntryForXPos(21, DataSet.Rounding.UP); + closest = set.getEntryForXValue(21, DataSet.Rounding.UP); assertEquals(21, closest.getX(), 0.01f); assertEquals(5, closest.getY(), 0.01f); - closest = set.getEntryForXPos(21, DataSet.Rounding.CLOSEST); + closest = set.getEntryForXValue(21, DataSet.Rounding.CLOSEST); assertEquals(21, closest.getX(), 0.01f); assertEquals(5, closest.getY(), 0.01f); } |