本文整理汇总了Java中com.github.mikephil.charting.data.RadarEntry.getY方法的典型用法代码示例。如果您正苦于以下问题:Java RadarEntry.getY方法的具体用法?Java RadarEntry.getY怎么用?Java RadarEntry.getY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.RadarEntry
的用法示例。
在下文中一共展示了RadarEntry.getY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawHighlighted
import com.github.mikephil.charting.data.RadarEntry; //导入方法依赖的package包/类
@Override
public void drawHighlighted(Canvas c, Highlight[] indices) {
float sliceangle = mChart.getSliceAngle();
// calculate the factor that is needed for transforming the value to
// pixels
float factor = mChart.getFactor();
MPPointF center = mChart.getCenterOffsets();
MPPointF pOut = MPPointF.getInstance(0,0);
RadarData radarData = mChart.getData();
for (Highlight high : indices) {
IRadarDataSet set = radarData.getDataSetByIndex(high.getDataSetIndex());
if (set == null || !set.isHighlightEnabled())
continue;
RadarEntry e = set.getEntryForIndex((int) high.getX());
if (!isInBoundsX(e, set))
continue;
float y = (e.getY() - mChart.getYChartMin());
Utils.getPosition(center,
y * factor * mAnimator.getPhaseY(),
sliceangle * high.getX() * mAnimator.getPhaseX() + mChart.getRotationAngle(),
pOut);
high.setDraw(pOut.x, pOut.y);
// draw the lines
drawHighlightLines(c, pOut.x, pOut.y, set);
if (set.isDrawHighlightCircleEnabled()) {
if (!Float.isNaN(pOut.x) && !Float.isNaN(pOut.y)) {
int strokeColor = set.getHighlightCircleStrokeColor();
if (strokeColor == ColorTemplate.COLOR_NONE) {
strokeColor = set.getColor(0);
}
if (set.getHighlightCircleStrokeAlpha() < 255) {
strokeColor = ColorTemplate.colorWithAlpha(strokeColor, set.getHighlightCircleStrokeAlpha());
}
drawHighlightCircle(c,
pOut,
set.getHighlightCircleInnerRadius(),
set.getHighlightCircleOuterRadius(),
set.getHighlightCircleFillColor(),
strokeColor,
set.getHighlightCircleStrokeWidth());
}
}
}
MPPointF.recycleInstance(center);
MPPointF.recycleInstance(pOut);
}
示例2: drawHighlighted
import com.github.mikephil.charting.data.RadarEntry; //导入方法依赖的package包/类
@Override
public void drawHighlighted(Canvas c, Highlight[] indices) {
float sliceangle = mChart.getSliceAngle();
// calculate the factor that is needed for transforming the value to
// pixels
float factor = mChart.getFactor();
MPPointF center = mChart.getCenterOffsets();
MPPointF pOut = MPPointF.getInstance(0,0);
RadarData radarData = mChart.getData();
for (Highlight high : indices) {
IRadarDataSet set = radarData.getDataSetByIndex(high.getDataSetIndex());
if (set == null || !set.isHighlightEnabled())
continue;
RadarEntry e = set.getEntryForIndex((int) high.getX());
if (!isInBoundsX(e, set))
continue;
float y = (e.getY() - mChart.getYChartMin());
Utils.getPosition(center,
y * factor * mAnimator.getPhaseY(),
sliceangle * high.getX() * mAnimator.getPhaseX() + mChart.getRotationAngle(),
pOut);
high.setDraw(pOut.x, pOut.y);
// draw the lines
drawHighlightLines(c, pOut.x, pOut.y, set);
if (set.isDrawHighlightCircleEnabled()) {
if (!Float.isNaN(pOut.x) && !Float.isNaN(pOut.y)) {
int strokeColor = set.getHighlightCircleStrokeColor();
if (strokeColor == ColorTemplate.COLOR_NONE) {
strokeColor = set.getColor(0);
}
if (set.getHighlightCircleStrokeAlpha() < 255) {
strokeColor = ColorTemplate.getColorWithAlphaComponent(strokeColor, set.getHighlightCircleStrokeAlpha());
}
drawHighlightCircle(c,
pOut,
set.getHighlightCircleInnerRadius(),
set.getHighlightCircleOuterRadius(),
set.getHighlightCircleFillColor(),
strokeColor,
set.getHighlightCircleStrokeWidth());
}
}
}
MPPointF.recycleInstance(center);
MPPointF.recycleInstance(pOut);
}