本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IDataSet.getEntryForXPos方法的典型用法代码示例。如果您正苦于以下问题:Java IDataSet.getEntryForXPos方法的具体用法?Java IDataSet.getEntryForXPos怎么用?Java IDataSet.getEntryForXPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.interfaces.datasets.IDataSet
的用法示例。
在下文中一共展示了IDataSet.getEntryForXPos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeEntry
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Removes the Entry object closest to the given DataSet at the
* specified index. Returns true if an Entry was removed, false if no Entry
* was found that meets the specified requirements.
*
* @param xPos
* @param dataSetIndex
* @return
*/
public boolean removeEntry(float xPos, int dataSetIndex) {
if (dataSetIndex >= mDataSets.size())
return false;
IDataSet dataSet = mDataSets.get(dataSetIndex);
Entry e = dataSet.getEntryForXPos(xPos);
if (e == null)
return false;
return removeEntry(e, dataSetIndex);
}
示例2: buildHighlight
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns the Highlight object corresponding to the selected xValue and dataSetIndex.
*
* @param set
* @param dataSetIndex
* @param xVal
* @param rounding
* @return
*/
protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) {
final Entry e = set.getEntryForXPos(xVal, rounding);
if (e == null)
return null;
MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY());
return new Highlight(e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency());
}
示例3: buildHighlight
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) {
final Entry e = set.getEntryForXPos(xVal, rounding);
MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getY(), e.getX());
return new Highlight(e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency());
}