/** * Highlights any y-value at the given x-value in the given DataSet. * Provide -1 as the dataSetIndex to undo all highlighting. * @param x The x-value to highlight * @param y The y-value to highlight. Supply `NaN` for "any" * @param dataSetIndex The dataset index to search in * @param callListener Should the listener be called for this change */ public void highlightValue(float x, float y, int dataSetIndex, boolean callListener) { if (dataSetIndex < 0 || dataSetIndex >= mData.getDataSetCount()) { highlightValue(null, callListener); } else { highlightValue(new Highlight(x, y, dataSetIndex), callListener); } }
@Override protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); List<BarLineScatterCandleBubbleData> dataObjects = mChart.getCombinedData().getAllData(); for (int i = 0; i < dataObjects.size(); i++) { ChartData dataObject = dataObjects.get(i); // in case of BarData, let the BarHighlighter take over if (barHighlighter != null && dataObject instanceof BarData) { Highlight high = barHighlighter.getHighlight(x, y); if (high != null) { high.setDataIndex(i); mHighlightBuffer.add(high); } } else { for (int j = 0, dataSetCount = dataObject.getDataSetCount(); j < dataSetCount; j++) { IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j); // don't include datasets that cannot be highlighted if (!dataSet.isHighlightEnabled()) continue; List<Highlight> highs = buildHighlights(dataSet, j, xVal, DataSet.Rounding.CLOSEST); for (Highlight high : highs) { high.setDataIndex(i); mHighlightBuffer.add(high); } } } } return mHighlightBuffer; }
/** * Get the Entry for a corresponding highlight object * * @param highlight * @return the entry that is highlighted */ @Override public Entry getEntryForHighlight(Highlight highlight) { if (highlight.getDataIndex() >= getAllData().size()) return null; ChartData data = getDataByIndex(highlight.getDataIndex()); if (highlight.getDataSetIndex() >= data.getDataSetCount()) return null; // The value of the highlighted entry could be NaN - // if we are not interested in highlighting a specific value. List<Entry> entries = data.getDataSetByIndex(highlight.getDataSetIndex()) .getEntriesForXValue(highlight.getX()); for (Entry entry : entries) if (entry.getY() == highlight.getY() || Float.isNaN(highlight.getY())) return entry; return null; }
for (int i = 0; i < data.getDataSetCount(); i++) {
/** * Highlights any y-value at the given x-value in the given DataSet. * Provide -1 as the dataSetIndex to undo all highlighting. * @param x The x-value to highlight * @param y The y-value to highlight. Supply `NaN` for "any" * @param dataSetIndex The dataset index to search in * @param callListener Should the listener be called for this change */ public void highlightValue(float x, float y, int dataSetIndex, boolean callListener) { if (dataSetIndex < 0 || dataSetIndex >= mData.getDataSetCount()) { highlightValue(null, callListener); } else { highlightValue(new Highlight(x, y, dataSetIndex), callListener); } }
/** * Highlights any y-value at the given x-value in the given DataSet. * Provide -1 as the dataSetIndex to undo all highlighting. * @param x The x-value to highlight * @param y The y-value to highlight. Supply `NaN` for "any" * @param dataSetIndex The dataset index to search in * @param callListener Should the listener be called for this change */ public void highlightValue(float x, float y, int dataSetIndex, boolean callListener) { if (dataSetIndex < 0 || dataSetIndex >= mData.getDataSetCount()) { highlightValue(null, callListener); } else { highlightValue(new Highlight(x, y, dataSetIndex), callListener); } }
/** * Highlights any y-value at the given x-value in the given DataSet. * Provide -1 as the dataSetIndex to undo all highlighting. * @param x The x-value to highlight * @param y The y-value to highlight. Supply `NaN` for "any" * @param dataSetIndex The dataset index to search in * @param callListener Should the listener be called for this change */ public void highlightValue(float x, float y, int dataSetIndex, boolean callListener) { if (dataSetIndex < 0 || dataSetIndex >= mData.getDataSetCount()) { highlightValue(null, callListener); } else { highlightValue(new Highlight(x, y, dataSetIndex), callListener); } }
/** * Highlights any y-value at the given x-value in the given DataSet. * Provide -1 as the dataSetIndex to undo all highlighting. * * @param x The x-value to highlight * @param y The y-value to highlight. Supply `NaN` for "any" * @param dataSetIndex The dataset index to search in * @param callListener Should the listener be called for this change */ public void highlightValue(float x, float y, int dataSetIndex, boolean callListener) { if (dataSetIndex < 0 || dataSetIndex >= mData.getDataSetCount()) { highlightValue(null, callListener); } else { highlightValue(new Highlight(x, y, dataSetIndex), callListener); } }
@Override protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); List<BarLineScatterCandleBubbleData> dataObjects = mChart.getCombinedData().getAllData(); for (int i = 0; i < dataObjects.size(); i++) { ChartData dataObject = dataObjects.get(i); // in case of BarData, let the BarHighlighter take over if (barHighlighter != null && dataObject instanceof BarData) { Highlight high = barHighlighter.getHighlight(x, y); if (high != null) { high.setDataIndex(i); mHighlightBuffer.add(high); } } else { for (int j = 0, dataSetCount = dataObject.getDataSetCount(); j < dataSetCount; j++) { IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j); // don't include datasets that cannot be highlighted if (!dataSet.isHighlightEnabled()) continue; List<Highlight> highs = buildHighlights(dataSet, j, xVal, DataSet.Rounding.CLOSEST); for (Highlight high : highs) { high.setDataIndex(i); mHighlightBuffer.add(high); } } } } return mHighlightBuffer; }
@Override protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); List<BarLineScatterCandleBubbleData> dataObjects = mChart.getCombinedData().getAllData(); for (int i = 0; i < dataObjects.size(); i++) { ChartData dataObject = dataObjects.get(i); // in case of BarData, let the BarHighlighter take over if (barHighlighter != null && dataObject instanceof BarData) { Highlight high = barHighlighter.getHighlight(x, y); if (high != null) { high.setDataIndex(i); mHighlightBuffer.add(high); } } else { for (int j = 0, dataSetCount = dataObject.getDataSetCount(); j < dataSetCount; j++) { IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j); // don't include datasets that cannot be highlighted if (!dataSet.isHighlightEnabled()) continue; List<Highlight> highs = buildHighlights(dataSet, j, xVal, DataSet.Rounding.CLOSEST); for (Highlight high : highs) { high.setDataIndex(i); mHighlightBuffer.add(high); } } } } return mHighlightBuffer; }
@Override protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); List<BarLineScatterCandleBubbleData> dataObjects = mChart.getCombinedData().getAllData(); for (int i = 0; i < dataObjects.size(); i++) { ChartData dataObject = dataObjects.get(i); // in case of BarData, let the BarHighlighter take over if (barHighlighter != null && dataObject instanceof BarData) { Highlight high = barHighlighter.getHighlight(x, y); if (high != null) { high.setDataIndex(i); mHighlightBuffer.add(high); } } else { for (int j = 0, dataSetCount = dataObject.getDataSetCount(); j < dataSetCount; j++) { IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j); // don't include datasets that cannot be highlighted if (!dataSet.isHighlightEnabled()) { continue; } List<Highlight> highs = buildHighlights(dataSet, j, xVal, DataSet.Rounding.CLOSEST); for (Highlight high : highs) { high.setDataIndex(i); mHighlightBuffer.add(high); } } } } return mHighlightBuffer; }
@Override protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) { mHighlightBuffer.clear(); List<BarLineScatterCandleBubbleData> dataObjects = mChart.getCombinedData().getAllData(); for (int i = 0; i < dataObjects.size(); i++) { ChartData dataObject = dataObjects.get(i); // in case of BarData, let the BarHighlighter take over if (barHighlighter != null && dataObject instanceof BarData) { Highlight high = barHighlighter.getHighlight(x, y); if (high != null) { high.setDataIndex(i); mHighlightBuffer.add(high); } } else { for (int j = 0, dataSetCount = dataObject.getDataSetCount(); j < dataSetCount; j++) { IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j); // don't include datasets that cannot be highlighted if (!dataSet.isHighlightEnabled()) continue; List<Highlight> highs = buildHighlights(dataSet, j, xVal, DataSet.Rounding.CLOSEST); for (Highlight high : highs) { high.setDataIndex(i); mHighlightBuffer.add(high); } } } } return mHighlightBuffer; }
if (highlight.getDataSetIndex() >= data.getDataSetCount()) { return null; } else {
/** * Get the Entry for a corresponding highlight object * * @param highlight * @return the entry that is highlighted */ @Override public Entry getEntryForHighlight(Highlight highlight) { if (highlight.getDataIndex() >= getAllData().size()) return null; ChartData data = getDataByIndex(highlight.getDataIndex()); if (highlight.getDataSetIndex() >= data.getDataSetCount()) return null; // The value of the highlighted entry could be NaN - // if we are not interested in highlighting a specific value. List<Entry> entries = data.getDataSetByIndex(highlight.getDataSetIndex()) .getEntriesForXValue(highlight.getX()); for (Entry entry : entries) if (entry.getY() == highlight.getY() || Float.isNaN(highlight.getY())) return entry; return null; }
/** * Get the Entry for a corresponding highlight object * * @param highlight * @return the entry that is highlighted */ @Override public Entry getEntryForHighlight(Highlight highlight) { if (highlight.getDataIndex() >= getAllData().size()) return null; ChartData data = getDataByIndex(highlight.getDataIndex()); if (highlight.getDataSetIndex() >= data.getDataSetCount()) return null; // The value of the highlighted entry could be NaN - // if we are not interested in highlighting a specific value. List<Entry> entries = data.getDataSetByIndex(highlight.getDataSetIndex()) .getEntriesForXValue(highlight.getX()); for (Entry entry : entries) if (entry.getY() == highlight.getY() || Float.isNaN(highlight.getY())) return entry; return null; }
/** * Get the Entry for a corresponding highlight object * * @param highlight * @return the entry that is highlighted */ @Override public Entry getEntryForHighlight(Highlight highlight) { if (highlight.getDataIndex() >= getAllData().size()) return null; ChartData data = getDataByIndex(highlight.getDataIndex()); if (highlight.getDataSetIndex() >= data.getDataSetCount()) return null; // The value of the highlighted entry could be NaN - // if we are not interested in highlighting a specific value. List<Entry> entries = data.getDataSetByIndex(highlight.getDataSetIndex()) .getEntriesForXValue(highlight.getX()); for (Entry entry : entries) if (entry.getY() == highlight.getY() || Float.isNaN(highlight.getY())) return entry; return null; }
for (int i = 0; i < data.getDataSetCount(); i++) {
for (int i = 0; i < data.getDataSetCount(); i++) {
for (int i = 0; i < data.getDataSetCount(); i++) {
for (int i = 0; i < data.getDataSetCount(); i++) {