本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IDataSet.getAxisDependency方法的典型用法代码示例。如果您正苦于以下问题:Java IDataSet.getAxisDependency方法的具体用法?Java IDataSet.getAxisDependency怎么用?Java IDataSet.getAxisDependency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.interfaces.datasets.IDataSet
的用法示例。
在下文中一共展示了IDataSet.getAxisDependency方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEntry
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Adds an Entry to the DataSet at the specified index.
* Entries are added to the end of the list.
*
* @param e
* @param dataSetIndex
*/
public void addEntry(Entry e, int dataSetIndex) {
if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {
IDataSet set = mDataSets.get(dataSetIndex);
// add the entry to the dataset
if (!set.addEntry(e))
return;
float val = e.getVal();
if (mYValCount == 0) {
mYMin = val;
mYMax = val;
if (set.getAxisDependency() == AxisDependency.LEFT) {
mLeftAxisMax = e.getVal();
mLeftAxisMin = e.getVal();
} else {
mRightAxisMax = e.getVal();
mRightAxisMin = e.getVal();
}
} else {
if (mYMax < val)
mYMax = val;
if (mYMin > val)
mYMin = val;
if (set.getAxisDependency() == AxisDependency.LEFT) {
if (mLeftAxisMax < e.getVal())
mLeftAxisMax = e.getVal();
if (mLeftAxisMin > e.getVal())
mLeftAxisMin = e.getVal();
} else {
if (mRightAxisMax < e.getVal())
mRightAxisMax = e.getVal();
if (mRightAxisMin > e.getVal())
mRightAxisMin = e.getVal();
}
}
mYValCount += 1;
handleEmptyAxis(getFirstLeft(), getFirstRight());
} else {
Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
}
}
示例2: addEntry
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Adds an Entry to the DataSet at the specified index.
* Entries are added to the end of the list.
*
* @param e
* @param dataSetIndex
*/
public void addEntry(Entry e, int dataSetIndex) {
if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {
IDataSet set = mDataSets.get(dataSetIndex);
// add the entry to the dataset
if (!set.addEntry(e))
return;
float val = e.getVal();
if (mYValCount == 0) {
mYMin = val;
mYMax = val;
if (set.getAxisDependency() == YAxis.AxisDependency.LEFT) {
mLeftAxisMax = e.getVal();
mLeftAxisMin = e.getVal();
} else {
mRightAxisMax = e.getVal();
mRightAxisMin = e.getVal();
}
} else {
if (mYMax < val)
mYMax = val;
if (mYMin > val)
mYMin = val;
if (set.getAxisDependency() == YAxis.AxisDependency.LEFT) {
if (mLeftAxisMax < e.getVal())
mLeftAxisMax = e.getVal();
if (mLeftAxisMin > e.getVal())
mLeftAxisMin = e.getVal();
} else {
if (mRightAxisMax < e.getVal())
mRightAxisMax = e.getVal();
if (mRightAxisMin > e.getVal())
mRightAxisMin = e.getVal();
}
}
mYValCount += 1;
handleEmptyAxis(getFirstLeft(), getFirstRight());
} else {
Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
}
}
示例3: 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());
}
示例4: 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());
}