本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IDataSet.getEntryForXIndex方法的典型用法代码示例。如果您正苦于以下问题:Java IDataSet.getEntryForXIndex方法的具体用法?Java IDataSet.getEntryForXIndex怎么用?Java IDataSet.getEntryForXIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.interfaces.datasets.IDataSet
的用法示例。
在下文中一共展示了IDataSet.getEntryForXIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeEntry
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Removes the Entry object at the given xIndex from the DataSet at the
* specified index. Returns true if an Entry was removed, false if no Entry
* was found that meets the specified requirements.
*
* @param xIndex
* @param dataSetIndex
* @return
*/
public boolean removeEntry(int xIndex, int dataSetIndex) {
if (dataSetIndex >= mDataSets.size())
return false;
IDataSet dataSet = mDataSets.get(dataSetIndex);
Entry e = dataSet.getEntryForXIndex(xIndex);
if (e == null || e.getXIndex() != xIndex)
return false;
return removeEntry(e, dataSetIndex);
}
示例2: getEntriesAtIndex
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Get all Entry objects at the given index across all DataSets.
* INFORMATION: This method does calculations at runtime. Do not over-use in
* performance critical situations.
*
* @param xIndex
* @return
*/
public List<Entry> getEntriesAtIndex(int xIndex) {
List<Entry> vals = new ArrayList<Entry>();
for (int i = 0; i < mData.getDataSetCount(); i++) {
IDataSet set = mData.getDataSetByIndex(i);
Entry e = set.getEntryForXIndex(xIndex);
if (e != null) {
vals.add(e);
}
}
return vals;
}