本文整理汇总了Java中com.github.mikephil.charting.data.RadarDataSet.getEntryForXIndex方法的典型用法代码示例。如果您正苦于以下问题:Java RadarDataSet.getEntryForXIndex方法的具体用法?Java RadarDataSet.getEntryForXIndex怎么用?Java RadarDataSet.getEntryForXIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.RadarDataSet
的用法示例。
在下文中一共展示了RadarDataSet.getEntryForXIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawHighlights
import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
protected void drawHighlights() {
// if there are values to highlight and highlighnting is enabled, do it
if (mHighlightEnabled && valuesToHighlight()) {
float sliceangle = getSliceAngle();
float factor = getFactor();
PointF c = getCenterOffsets();
for (int i = 0; i < mIndicesToHightlight.length; i++) {
RadarDataSet set = mData
.getDataSetByIndex(mIndicesToHightlight[i]
.getDataSetIndex());
if (set == null)
continue;
mHighlightPaint.setColor(set.getHighLightColor());
// get the index to highlight
int xIndex = mIndicesToHightlight[i].getXIndex();
Entry e = set.getEntryForXIndex(xIndex);
int j = set.getEntryPosition(e);
float y = e.getVal();
PointF p = getPosition(c, y * factor, sliceangle * j + mRotationAngle);
float[] pts = new float[] {
p.x, 0, p.x, getHeight(), 0, p.y, getWidth(), p.y
};
mDrawCanvas.drawLines(pts, mHighlightPaint);
}
}
}
示例2: drawHighlights
import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
protected void drawHighlights() {
// if there are values to highlight and highlighnting is enabled, do it
if (mHighlightEnabled && valuesToHighlight()) {
float sliceangle = getSliceAngle();
float factor = getFactor();
PointF c = getCenterOffsets();
for (int i = 0; i < mIndicesToHightlight.length; i++) {
RadarDataSet set = mCurrentData
.getDataSetByIndex(mIndicesToHightlight[i]
.getDataSetIndex());
if (set == null)
continue;
mHighlightPaint.setColor(set.getHighLightColor());
// get the index to highlight
int xIndex = mIndicesToHightlight[i].getXIndex();
Entry e = set.getEntryForXIndex(xIndex);
int j = set.getEntryPosition(e);
float y = e.getVal();
PointF p = getPosition(c, y * factor, sliceangle * j + mRotationAngle);
float[] pts = new float[] {
p.x, 0, p.x, getHeight(), 0, p.y, getWidth(), p.y
};
mDrawCanvas.drawLines(pts, mHighlightPaint);
}
}
}
示例3: drawHighlighted
import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
public void drawHighlighted(Canvas c, Highlight[] indices) {
float sliceangle = mChart.getSliceAngle();
float factor = mChart.getFactor();
PointF center = mChart.getCenterOffsets();
for (int i = 0; i < indices.length; i++) {
RadarDataSet set = mChart.getData()
.getDataSetByIndex(indices[i]
.getDataSetIndex());
if (set == null || !set.isHighlightEnabled())
continue;
// get the index to highlight
int xIndex = indices[i].getXIndex();
Entry e = set.getEntryForXIndex(xIndex);
if (e == null || e.getXIndex() != xIndex)
continue;
int j = set.getEntryPosition(e);
float y = (e.getVal() - mChart.getYChartMin());
if (Float.isNaN(y))
continue;
PointF p = Utils.getPosition(center, y * factor,
sliceangle * j + mChart.getRotationAngle());
float[] pts = new float[]{
p.x, p.y
};
// draw the lines
drawHighlightLines(c, pts, set);
}
}